本文整理汇总了Python中cybox.common.PatternFieldGroup.is_plain方法的典型用法代码示例。如果您正苦于以下问题:Python PatternFieldGroup.is_plain方法的具体用法?Python PatternFieldGroup.is_plain怎么用?Python PatternFieldGroup.is_plain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cybox.common.PatternFieldGroup
的用法示例。
在下文中一共展示了PatternFieldGroup.is_plain方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: is_plain
# 需要导入模块: from cybox.common import PatternFieldGroup [as 别名]
# 或者: from cybox.common.PatternFieldGroup import is_plain [as 别名]
def is_plain(self):
"""Whether the Property can be represented as a single value.
The `datatype` can be inferred by the particular BaseProperty subclass,
so if `datatype` and `value` are the only non-None properties, the
BaseProperty can be represented by a single value rather than a
dictionary. This makes the JSON representation simpler without losing
any data fidelity.
"""
return (
# ignore value
self.id_ is None and
self.idref is None and
# ignore datatype
self.appears_random is None and
self.is_obfuscated is None and
self.obfuscation_algorithm_ref is None and
self.is_defanged is None and
self.defanging_algorithm_ref is None and
self.refanging_transform_type is None and
self.refanging_transform is None and
self.observed_encoding is None and
PatternFieldGroup.is_plain(self)
)
示例2: is_plain
# 需要导入模块: from cybox.common import PatternFieldGroup [as 别名]
# 或者: from cybox.common.PatternFieldGroup import is_plain [as 别名]
def is_plain(self):
"""Whether the VocabString can be represented as a single value.
"""
return (
self.xsi_type is None and
self.vocab_name is None and
self.vocab_reference is None and
PatternFieldGroup.is_plain(self)
)
示例3: is_plain
# 需要导入模块: from cybox.common import PatternFieldGroup [as 别名]
# 或者: from cybox.common.PatternFieldGroup import is_plain [as 别名]
def is_plain(self):
"""Whether the VocabString can be represented as a single value.
If `xsi:type` and `value` are the only non-None properties, the
VocabString can be represented by a single value rather than a
dictionary. This makes the JSON representation simpler without losing
any data fidelity.
"""
return (
# ignore value and xsi_type
self.vocab_name is None and
self.vocab_reference is None and
PatternFieldGroup.is_plain(self)
)
示例4: is_plain
# 需要导入模块: from cybox.common import PatternFieldGroup [as 别名]
# 或者: from cybox.common.PatternFieldGroup import is_plain [as 别名]
def is_plain(self):
"""Whether the VocabString can be represented as a single value.
If `value` is the only non-None properties and a custom XSI type has
not been set, the VocabString can be represented by a single value
rather than a dictionary. This makes the JSON representation simpler
without losing any data fidelity.
"""
return (
# ignore value
self.vocab_name is None and
self.vocab_reference is None and
self.xsi_type == self._XSI_TYPE and
PatternFieldGroup.is_plain(self)
)