MCPcopy Create free account
hub / github.com/STIXProject/python-stix / StatementField

Class StatementField

stix/common/statement.py:73–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72
73class StatementField(mixbox.fields.TypedField):
74 def __init__(self, *args, **kwargs):
75 self._vocab_type = kwargs.pop("vocab_type")
76 super(StatementField, self).__init__(*args, **kwargs)
77 self.type_ = Statement
78
79 def _clean(self, value):
80 if value is None:
81 return None
82 elif isinstance(value, Statement):
83 return value
84 elif isinstance(value, stix.common.VocabString):
85 return Statement(value)
86 else:
87 vocabklass = self._vocab_type
88 return Statement(vocabklass(value))

Callers 4

TTPClass · 0.90
IncidentClass · 0.90
ThreatActorClass · 0.90
CampaignClass · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected