Package security.whisper.javastix.meta
Class ExtensionDefinitionObject.Builder
java.lang.Object
security.whisper.javastix.meta.ExtensionDefinitionObject.Builder
- Enclosing class:
ExtensionDefinitionObject
Builds instances of type
ExtensionDefinitionObject.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionaddAllExtensionProperties(Iterable<String> elements) Adds elements toextensionPropertiesset.addAllExtensionTypes(Iterable<String> elements) Adds elements toextensionTypesset.addAllExternalReferences(Iterable<? extends ExternalReferenceType> elements) Adds elements toexternalReferencesset.addAllGranularMarkings(Iterable<? extends GranularMarkingDm> elements) Adds elements togranularMarkingsset.addAllLabels(Iterable<String> elements) Adds elements tolabelsset.addAllObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Adds elements toobjectMarkingRefsset.addExtensionProperties(String... elements) Adds elements toextensionPropertiesset.addExtensionProperty(String element) Adds one element toextensionPropertiesset.addExtensionType(String element) Adds one element toextensionTypesset.addExtensionTypes(String... elements) Adds elements toextensionTypesset.Adds one element toexternalReferencesset.addExternalReferences(ExternalReferenceType... elements) Adds elements toexternalReferencesset.addGranularMarking(GranularMarkingDm element) Adds one element togranularMarkingsset.addGranularMarkings(GranularMarkingDm... elements) Adds elements togranularMarkingsset.Adds one element tolabelsset.Adds elements tolabelsset.addObjectMarkingRef(MarkingDefinitionDm element) Adds one element toobjectMarkingRefsset.addObjectMarkingRefs(MarkingDefinitionDm... elements) Adds elements toobjectMarkingRefsset.build()Builds a newExtensionDefinitionObject.confidence(int confidence) Initializes the optional valueconfidenceto confidence.confidence(Optional<Integer> confidence) Initializes the optional valueconfidenceto confidence.created(StixInstant created) Initializes the value for thecreatedattribute.createdByRef(String createdByRef) Initializes the optional valuecreatedByRefto createdByRef.createdByRef(Optional<String> createdByRef) Initializes the optional valuecreatedByRefto createdByRef.customProperties(Map<String, ? extends Object> entries) Sets or replaces all mappings from the specified map as entries for thecustomPropertiesmap.description(String description) Initializes the optional valuedescriptionto description.description(Optional<String> description) Initializes the optional valuedescriptionto description.extensionProperties(Iterable<String> elements) Sets or replaces all elements forextensionPropertiesset.extensionTypes(Iterable<String> elements) Sets or replaces all elements forextensionTypesset.externalReferences(Iterable<? extends ExternalReferenceType> elements) Sets or replaces all elements forexternalReferencesset.from(BundleableObject instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.bundle.BundleableObjectinstance.from(StixCustomProperties instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.common.StixCustomPropertiesinstance.from(ExtensionDefinition instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.meta.ExtensionDefinitioninstance.granularMarkings(Iterable<? extends GranularMarkingDm> elements) Sets or replaces all elements forgranularMarkingsset.hydrated(boolean hydrated) Initializes the value for thehydratedattribute.Initializes the value for theidattribute.Sets or replaces all elements forlabelsset.modified(StixInstant modified) Initializes the value for themodifiedattribute.Initializes the value for thenameattribute.objectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Sets or replaces all elements forobjectMarkingRefsset.putAllCustomProperties(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries tocustomPropertiesmap.putAllSchema(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries toschemamap.putCustomProperty(String key, Object value) Put one entry to thecustomPropertiesmap.putCustomProperty(Map.Entry<String, ? extends Object> entry) Put one entry to thecustomPropertiesmap.Put one entry to theschemamap.Put one entry to theschemamap.revoked(boolean revoked) Initializes the optional valuerevokedto revoked.Initializes the optional valuerevokedto revoked.Sets or replaces all mappings from the specified map as entries for theschemamap.specVersion(String specVersion) Initializes the value for thespecVersionattribute.toJsonString(String toJsonString) Initializes the value for thetoJsonStringattribute.Initializes the value for theversionattribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder from(BundleableObject instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.bundle.BundleableObjectinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder from(StixCustomProperties instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.common.StixCustomPropertiesinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder from(ExtensionDefinition instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.meta.ExtensionDefinitioninstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the identifier for this Extension Definition object.") public final ExtensionDefinitionObject.Builder id(String id) Initializes the value for theidattribute.- Parameters:
id- The value for id (can benull)- Returns:
thisbuilder for use in a chained invocation
-
specVersion
@CanIgnoreReturnValue @JsonPropertyDescription("The version of the STIX specification used to represent this object.") public final ExtensionDefinitionObject.Builder specVersion(String specVersion) Initializes the value for thespecVersionattribute.If not set, this attribute will have a default value as returned by the initializer of
specVersion.- Parameters:
specVersion- The value for specVersion- Returns:
thisbuilder for use in a chained invocation
-
createdByRef
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder createdByRef(String createdByRef) Initializes the optional valuecreatedByRefto createdByRef.- Parameters:
createdByRef- The value for createdByRef- Returns:
thisbuilder for chained invocation
-
createdByRef
@CanIgnoreReturnValue @JsonPropertyDescription("The ID of the identity that created this extension definition.") public final ExtensionDefinitionObject.Builder createdByRef(Optional<String> createdByRef) Initializes the optional valuecreatedByRefto createdByRef.- Parameters:
createdByRef- The value for createdByRef- Returns:
thisbuilder for use in a chained invocation
-
created
@CanIgnoreReturnValue @JsonPropertyDescription("The created property represents the time at which this object was originally created.") public final ExtensionDefinitionObject.Builder created(StixInstant created) Initializes the value for thecreatedattribute.- Parameters:
created- The value for created (can benull)- Returns:
thisbuilder for use in a chained invocation
-
modified
@CanIgnoreReturnValue @JsonPropertyDescription("The modified property represents the time at which this object was last modified.") public final ExtensionDefinitionObject.Builder modified(StixInstant modified) Initializes the value for themodifiedattribute.- Parameters:
modified- The value for modified (can benull)- Returns:
thisbuilder for use in a chained invocation
-
revoked
Initializes the optional valuerevokedto revoked.- Parameters:
revoked- The value for revoked- Returns:
thisbuilder for chained invocation
-
revoked
@CanIgnoreReturnValue @JsonPropertyDescription("The revoked property is a boolean that indicates whether the object has been revoked.") public final ExtensionDefinitionObject.Builder revoked(Optional<Boolean> revoked) Initializes the optional valuerevokedto revoked.- Parameters:
revoked- The value for revoked- Returns:
thisbuilder for use in a chained invocation
-
addLabel
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addLabel(@Nullable String element) Adds one element tolabelsset.- Parameters:
element- A labels element- Returns:
thisbuilder for use in a chained invocation
-
addLabels
Adds elements tolabelsset.- Parameters:
elements- An array of labels elements- Returns:
thisbuilder for use in a chained invocation
-
labels
@CanIgnoreReturnValue @JsonPropertyDescription("The labels property specifies a set of categorization labels.") public final ExtensionDefinitionObject.Builder labels(Iterable<String> elements) Sets or replaces all elements forlabelsset.- Parameters:
elements- An iterable of labels elements- Returns:
thisbuilder for use in a chained invocation
-
addAllLabels
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addAllLabels(Iterable<String> elements) Adds elements tolabelsset.- Parameters:
elements- An iterable of labels elements- Returns:
thisbuilder for use in a chained invocation
-
confidence
Initializes the optional valueconfidenceto confidence.- Parameters:
confidence- The value for confidence- Returns:
thisbuilder for chained invocation
-
confidence
@CanIgnoreReturnValue @JsonPropertyDescription("The confidence property identifies the confidence that the creator has in the correctness of their data.") public final ExtensionDefinitionObject.Builder confidence(Optional<Integer> confidence) Initializes the optional valueconfidenceto confidence.- Parameters:
confidence- The value for confidence- Returns:
thisbuilder for use in a chained invocation
-
addExternalReference
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addExternalReference(@Nullable ExternalReferenceType element) Adds one element toexternalReferencesset.- Parameters:
element- A externalReferences element- Returns:
thisbuilder for use in a chained invocation
-
addExternalReferences
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addExternalReferences(ExternalReferenceType... elements) Adds elements toexternalReferencesset.- Parameters:
elements- An array of externalReferences elements- Returns:
thisbuilder for use in a chained invocation
-
externalReferences
@CanIgnoreReturnValue @JsonPropertyDescription("A list of external references which refer to non-STIX information.") public final ExtensionDefinitionObject.Builder externalReferences(Iterable<? extends ExternalReferenceType> elements) Sets or replaces all elements forexternalReferencesset.- Parameters:
elements- An iterable of externalReferences elements- Returns:
thisbuilder for use in a chained invocation
-
addAllExternalReferences
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addAllExternalReferences(Iterable<? extends ExternalReferenceType> elements) Adds elements toexternalReferencesset.- Parameters:
elements- An iterable of externalReferences elements- Returns:
thisbuilder for use in a chained invocation
-
addObjectMarkingRef
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addObjectMarkingRef(@Nullable MarkingDefinitionDm element) Adds one element toobjectMarkingRefsset.- Parameters:
element- A objectMarkingRefs element- Returns:
thisbuilder for use in a chained invocation
-
addObjectMarkingRefs
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addObjectMarkingRefs(MarkingDefinitionDm... elements) Adds elements toobjectMarkingRefsset.- Parameters:
elements- An array of objectMarkingRefs elements- Returns:
thisbuilder for use in a chained invocation
-
objectMarkingRefs
@CanIgnoreReturnValue @JsonPropertyDescription("The list of marking-definition objects to be applied to this object.") public final ExtensionDefinitionObject.Builder objectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Sets or replaces all elements forobjectMarkingRefsset.- Parameters:
elements- An iterable of objectMarkingRefs elements- Returns:
thisbuilder for use in a chained invocation
-
addAllObjectMarkingRefs
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addAllObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Adds elements toobjectMarkingRefsset.- Parameters:
elements- An iterable of objectMarkingRefs elements- Returns:
thisbuilder for use in a chained invocation
-
addGranularMarking
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addGranularMarking(@Nullable GranularMarkingDm element) Adds one element togranularMarkingsset.- Parameters:
element- A granularMarkings element- Returns:
thisbuilder for use in a chained invocation
-
addGranularMarkings
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addGranularMarkings(GranularMarkingDm... elements) Adds elements togranularMarkingsset.- Parameters:
elements- An array of granularMarkings elements- Returns:
thisbuilder for use in a chained invocation
-
granularMarkings
@CanIgnoreReturnValue @JsonPropertyDescription("The set of granular markings that apply to this object.") public final ExtensionDefinitionObject.Builder granularMarkings(Iterable<? extends GranularMarkingDm> elements) Sets or replaces all elements forgranularMarkingsset.- Parameters:
elements- An iterable of granularMarkings elements- Returns:
thisbuilder for use in a chained invocation
-
addAllGranularMarkings
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addAllGranularMarkings(Iterable<? extends GranularMarkingDm> elements) Adds elements togranularMarkingsset.- Parameters:
elements- An iterable of granularMarkings elements- Returns:
thisbuilder for use in a chained invocation
-
name
@CanIgnoreReturnValue @JsonPropertyDescription("The name of this extension.") public final ExtensionDefinitionObject.Builder name(String name) Initializes the value for thenameattribute.- Parameters:
name- The value for name (can benull)- Returns:
thisbuilder for use in a chained invocation
-
description
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder description(String description) Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for chained invocation
-
description
@CanIgnoreReturnValue @JsonPropertyDescription("A detailed description of this extension.") public final ExtensionDefinitionObject.Builder description(Optional<String> description) Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for use in a chained invocation
-
putSchema
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder putSchema(String key, Object value) Put one entry to theschemamap.- Parameters:
key- The key in the schema mapvalue- The associated value in the schema map- Returns:
thisbuilder for use in a chained invocation
-
putSchema
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder putSchema(Map.Entry<String, ? extends Object> entry) Put one entry to theschemamap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
schema
@CanIgnoreReturnValue @JsonPropertyDescription("The JSON schema for this extension.") public final ExtensionDefinitionObject.Builder schema(Map<String, ? extends Object> entries) Sets or replaces all mappings from the specified map as entries for theschemamap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the schema map- Returns:
thisbuilder for use in a chained invocation
-
putAllSchema
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder putAllSchema(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries toschemamap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the schema map- Returns:
thisbuilder for use in a chained invocation
-
version
@CanIgnoreReturnValue @JsonPropertyDescription("The version of this extension.") public final ExtensionDefinitionObject.Builder version(String version) Initializes the value for theversionattribute.- Parameters:
version- The value for version (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addExtensionType
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addExtensionType(@Nullable String element) Adds one element toextensionTypesset.- Parameters:
element- A extensionTypes element- Returns:
thisbuilder for use in a chained invocation
-
addExtensionTypes
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addExtensionTypes(String... elements) Adds elements toextensionTypesset.- Parameters:
elements- An array of extensionTypes elements- Returns:
thisbuilder for use in a chained invocation
-
extensionTypes
@CanIgnoreReturnValue @JsonPropertyDescription("A list of the types of STIX Objects that this extension can be applied to.") public final ExtensionDefinitionObject.Builder extensionTypes(Iterable<String> elements) Sets or replaces all elements forextensionTypesset.- Parameters:
elements- An iterable of extensionTypes elements- Returns:
thisbuilder for use in a chained invocation
-
addAllExtensionTypes
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addAllExtensionTypes(Iterable<String> elements) Adds elements toextensionTypesset.- Parameters:
elements- An iterable of extensionTypes elements- Returns:
thisbuilder for use in a chained invocation
-
addExtensionProperty
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addExtensionProperty(@Nullable String element) Adds one element toextensionPropertiesset.- Parameters:
element- A extensionProperties element- Returns:
thisbuilder for use in a chained invocation
-
addExtensionProperties
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addExtensionProperties(String... elements) Adds elements toextensionPropertiesset.- Parameters:
elements- An array of extensionProperties elements- Returns:
thisbuilder for use in a chained invocation
-
extensionProperties
@CanIgnoreReturnValue @JsonPropertyDescription("The list of properties that this extension adds to the objects it extends.") public final ExtensionDefinitionObject.Builder extensionProperties(Iterable<String> elements) Sets or replaces all elements forextensionPropertiesset.- Parameters:
elements- An iterable of extensionProperties elements- Returns:
thisbuilder for use in a chained invocation
-
addAllExtensionProperties
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addAllExtensionProperties(Iterable<String> elements) Adds elements toextensionPropertiesset.- Parameters:
elements- An iterable of extensionProperties elements- Returns:
thisbuilder for use in a chained invocation
-
hydrated
Initializes the value for thehydratedattribute.- Parameters:
hydrated- The value for hydrated- Returns:
thisbuilder for use in a chained invocation
-
toJsonString
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder toJsonString(String toJsonString) Initializes the value for thetoJsonStringattribute.- Parameters:
toJsonString- The value for toJsonString (can benull)- Returns:
thisbuilder for use in a chained invocation
-
putCustomProperty
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder putCustomProperty(String key, Object value) Put one entry to thecustomPropertiesmap.- Parameters:
key- The key in the customProperties mapvalue- The associated value in the customProperties map- Returns:
thisbuilder for use in a chained invocation
-
putCustomProperty
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder putCustomProperty(Map.Entry<String, ? extends Object> entry) Put one entry to thecustomPropertiesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
customProperties
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder customProperties(Map<String, ? extends Object> entries) Sets or replaces all mappings from the specified map as entries for thecustomPropertiesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the customProperties map- Returns:
thisbuilder for use in a chained invocation
-
putAllCustomProperties
@CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder putAllCustomProperties(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries tocustomPropertiesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the customProperties map- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newExtensionDefinitionObject.- Returns:
- An immutable instance of ExtensionDefinition
- Throws:
IllegalStateException- if any required attributes are missing
-