Class LanguageContentObject.Builder

java.lang.Object
security.whisper.javastix.meta.LanguageContentObject.Builder
Enclosing class:
LanguageContentObject

@NotThreadSafe public static final class LanguageContentObject.Builder extends Object
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 Details

    • from

      @CanIgnoreReturnValue public final LanguageContentObject.Builder from(BundleableObject instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.bundle.BundleableObject instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final LanguageContentObject.Builder from(StixCustomProperties instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.common.StixCustomProperties instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final LanguageContentObject.Builder from(LanguageContent instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.meta.LanguageContent instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder 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 the id attribute.
      Parameters:
      id - The value for id (can be null)
      Returns:
      this builder 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 the specVersion attribute.

      If not set, this attribute will have a default value as returned by the initializer of specVersion.

      Parameters:
      specVersion - The value for specVersion
      Returns:
      this builder for use in a chained invocation
    • createdByRef

      @CanIgnoreReturnValue public final LanguageContentObject.Builder createdByRef(String createdByRef)
      Initializes the optional value createdByRef to createdByRef.
      Parameters:
      createdByRef - The value for createdByRef
      Returns:
      this builder 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 value createdByRef to createdByRef.
      Parameters:
      createdByRef - The value for createdByRef
      Returns:
      this builder 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 the created attribute.
      Parameters:
      created - The value for created (can be null)
      Returns:
      this builder 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 the modified attribute.
      Parameters:
      modified - The value for modified (can be null)
      Returns:
      this builder for use in a chained invocation
    • revoked

      @CanIgnoreReturnValue public final LanguageContentObject.Builder revoked(boolean revoked)
      Initializes the optional value revoked to revoked.
      Parameters:
      revoked - The value for revoked
      Returns:
      this builder 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 value revoked to revoked.
      Parameters:
      revoked - The value for revoked
      Returns:
      this builder for use in a chained invocation
    • addLabel

      @CanIgnoreReturnValue public final LanguageContentObject.Builder addLabel(@Nullable String element)
      Adds one element to labels set.
      Parameters:
      element - A labels element
      Returns:
      this builder for use in a chained invocation
    • addLabels

      @CanIgnoreReturnValue public final LanguageContentObject.Builder addLabels(String... elements)
      Adds elements to labels set.
      Parameters:
      elements - An array of labels elements
      Returns:
      this builder 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 for labels set.
      Parameters:
      elements - An iterable of labels elements
      Returns:
      this builder for use in a chained invocation
    • addAllLabels

      @CanIgnoreReturnValue public final LanguageContentObject.Builder addAllLabels(Iterable<String> elements)
      Adds elements to labels set.
      Parameters:
      elements - An iterable of labels elements
      Returns:
      this builder for use in a chained invocation
    • confidence

      @CanIgnoreReturnValue public final LanguageContentObject.Builder confidence(int confidence)
      Initializes the optional value confidence to confidence.
      Parameters:
      confidence - The value for confidence
      Returns:
      this builder 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 value confidence to confidence.
      Parameters:
      confidence - The value for confidence
      Returns:
      this builder for use in a chained invocation
    • addExternalReference

      @CanIgnoreReturnValue public final LanguageContentObject.Builder addExternalReference(@Nullable ExternalReferenceType element)
      Adds one element to externalReferences set.
      Parameters:
      element - A externalReferences element
      Returns:
      this builder for use in a chained invocation
    • addExternalReferences

      @CanIgnoreReturnValue public final LanguageContentObject.Builder addExternalReferences(ExternalReferenceType... elements)
      Adds elements to externalReferences set.
      Parameters:
      elements - An array of externalReferences elements
      Returns:
      this builder 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 for externalReferences set.
      Parameters:
      elements - An iterable of externalReferences elements
      Returns:
      this builder for use in a chained invocation
    • addAllExternalReferences

      @CanIgnoreReturnValue public final LanguageContentObject.Builder addAllExternalReferences(Iterable<? extends ExternalReferenceType> elements)
      Adds elements to externalReferences set.
      Parameters:
      elements - An iterable of externalReferences elements
      Returns:
      this builder for use in a chained invocation
    • addObjectMarkingRef

      @CanIgnoreReturnValue public final LanguageContentObject.Builder addObjectMarkingRef(@Nullable MarkingDefinitionDm element)
      Adds one element to objectMarkingRefs set.
      Parameters:
      element - A objectMarkingRefs element
      Returns:
      this builder for use in a chained invocation
    • addObjectMarkingRefs

      @CanIgnoreReturnValue public final LanguageContentObject.Builder addObjectMarkingRefs(MarkingDefinitionDm... elements)
      Adds elements to objectMarkingRefs set.
      Parameters:
      elements - An array of objectMarkingRefs elements
      Returns:
      this builder 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 for objectMarkingRefs set.
      Parameters:
      elements - An iterable of objectMarkingRefs elements
      Returns:
      this builder for use in a chained invocation
    • addAllObjectMarkingRefs

      @CanIgnoreReturnValue public final LanguageContentObject.Builder addAllObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements)
      Adds elements to objectMarkingRefs set.
      Parameters:
      elements - An iterable of objectMarkingRefs elements
      Returns:
      this builder for use in a chained invocation
    • addGranularMarking

      @CanIgnoreReturnValue public final LanguageContentObject.Builder addGranularMarking(@Nullable GranularMarkingDm element)
      Adds one element to granularMarkings set.
      Parameters:
      element - A granularMarkings element
      Returns:
      this builder for use in a chained invocation
    • addGranularMarkings

      @CanIgnoreReturnValue public final LanguageContentObject.Builder addGranularMarkings(GranularMarkingDm... elements)
      Adds elements to granularMarkings set.
      Parameters:
      elements - An array of granularMarkings elements
      Returns:
      this builder 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 for granularMarkings set.
      Parameters:
      elements - An iterable of granularMarkings elements
      Returns:
      this builder for use in a chained invocation
    • addAllGranularMarkings

      @CanIgnoreReturnValue public final LanguageContentObject.Builder addAllGranularMarkings(Iterable<? extends GranularMarkingDm> elements)
      Adds elements to granularMarkings set.
      Parameters:
      elements - An iterable of granularMarkings elements
      Returns:
      this builder 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 the objectRef attribute.
      Parameters:
      objectRef - The value for objectRef (can be null)
      Returns:
      this builder 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 the objectModified attribute.
      Parameters:
      objectModified - The value for objectModified (can be null)
      Returns:
      this builder for use in a chained invocation
    • putContent

      @CanIgnoreReturnValue public final LanguageContentObject.Builder putContent(String key, Map<String,String> value)
      Put one entry to the contents map.
      Parameters:
      key - The key in the contents map
      value - The associated value in the contents map
      Returns:
      this builder 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 the contents map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder 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 the contents map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the contents map
      Returns:
      this builder 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 to contents map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the contents map
      Returns:
      this builder for use in a chained invocation
    • hydrated

      @CanIgnoreReturnValue public final LanguageContentObject.Builder hydrated(boolean hydrated)
      Initializes the value for the hydrated attribute.
      Parameters:
      hydrated - The value for hydrated
      Returns:
      this builder for use in a chained invocation
    • toJsonString

      @CanIgnoreReturnValue public final LanguageContentObject.Builder toJsonString(String toJsonString)
      Initializes the value for the toJsonString attribute.
      Parameters:
      toJsonString - The value for toJsonString (can be null)
      Returns:
      this builder for use in a chained invocation
    • putCustomProperty

      @CanIgnoreReturnValue public final LanguageContentObject.Builder putCustomProperty(String key, Object value)
      Put one entry to the customProperties map.
      Parameters:
      key - The key in the customProperties map
      value - The associated value in the customProperties map
      Returns:
      this builder for use in a chained invocation
    • putCustomProperty

      @CanIgnoreReturnValue public final LanguageContentObject.Builder putCustomProperty(Map.Entry<String,? extends Object> entry)
      Put one entry to the customProperties map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder 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 the customProperties map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the customProperties map
      Returns:
      this builder 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 to customProperties map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the customProperties map
      Returns:
      this builder for use in a chained invocation
    • build

      public LanguageContentObject build()
      Builds a new LanguageContentObject.
      Returns:
      An immutable instance of LanguageContent
      Throws:
      IllegalStateException - if any required attributes are missing