Package security.whisper.javastix.meta
Class LanguageContentObject.Builder
java.lang.Object
security.whisper.javastix.meta.LanguageContentObject.Builder
- Enclosing class:
LanguageContentObject
Builds instances of type
LanguageContentObject.
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 TypeMethodDescriptionaddAllExternalReferences(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.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 newLanguageContentObject.confidence(int confidence) Initializes the optional valueconfidenceto confidence.confidence(Optional<Integer> confidence) Initializes the optional valueconfidenceto confidence.Sets or replaces all mappings from the specified map as entries for thecontentsmap.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.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(LanguageContent instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.meta.LanguageContentinstance.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.objectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Sets or replaces all elements forobjectMarkingRefsset.objectModified(StixInstant objectModified) Initializes the value for theobjectModifiedattribute.Initializes the value for theobjectRefattribute.Put all mappings from the specified map as entries tocontentsmap.putAllCustomProperties(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries tocustomPropertiesmap.putContent(String key, Map<String, String> value) Put one entry to thecontentsmap.Put one entry to thecontentsmap.putCustomProperty(String key, Object value) Put one entry to thecustomPropertiesmap.putCustomProperty(Map.Entry<String, ? extends Object> entry) Put one entry to thecustomPropertiesmap.revoked(boolean revoked) Initializes the optional valuerevokedto revoked.Initializes the optional valuerevokedto revoked.specVersion(String specVersion) Initializes the value for thespecVersionattribute.toJsonString(String toJsonString) Initializes the value for thetoJsonStringattribute.
-
Method Details
-
from
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 LanguageContentObject.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
Fill a builder with attribute values from the providedsecurity.whisper.javastix.meta.LanguageContentinstance.- 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 Language Content object.") public final LanguageContentObject.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 LanguageContentObject.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
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 language content object.") public final LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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
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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.Builder addAllGranularMarkings(Iterable<? extends GranularMarkingDm> elements) Adds elements togranularMarkingsset.- Parameters:
elements- An iterable of granularMarkings elements- Returns:
thisbuilder for use in a chained invocation
-
objectRef
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the identifier of the object that this language content applies to.") public final LanguageContentObject.Builder objectRef(String objectRef) Initializes the value for theobjectRefattribute.- Parameters:
objectRef- The value for objectRef (can benull)- Returns:
thisbuilder for use in a chained invocation
-
objectModified
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the modified time of the object that this language content applies to.") public final LanguageContentObject.Builder objectModified(StixInstant objectModified) Initializes the value for theobjectModifiedattribute.- Parameters:
objectModified- The value for objectModified (can benull)- Returns:
thisbuilder for use in a chained invocation
-
putContent
@CanIgnoreReturnValue public final LanguageContentObject.Builder putContent(String key, Map<String, String> value) Put one entry to thecontentsmap.- Parameters:
key- The key in the contents mapvalue- The associated value in the contents map- Returns:
thisbuilder for use in a chained invocation
-
putContent
@CanIgnoreReturnValue public final LanguageContentObject.Builder putContent(Map.Entry<String, ? extends Map<String, String>> entry) Put one entry to thecontentsmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
contents
@CanIgnoreReturnValue @JsonPropertyDescription("A dictionary that captures the text content in different languages. The key is the language code and the value is a dictionary containing the translated content.") public final LanguageContentObject.Builder contents(Map<String, ? extends Map<String, String>> entries) Sets or replaces all mappings from the specified map as entries for thecontentsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the contents map- Returns:
thisbuilder for use in a chained invocation
-
putAllContents
@CanIgnoreReturnValue public final LanguageContentObject.Builder putAllContents(Map<String, ? extends Map<String, String>> entries) Put all mappings from the specified map as entries tocontentsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the contents map- 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
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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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 LanguageContentObject.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 newLanguageContentObject.- Returns:
- An immutable instance of LanguageContent
- Throws:
IllegalStateException- if any required attributes are missing
-