Class ExtensionDefinitionObject.Builder

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

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

    • from

      @CanIgnoreReturnValue public final ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.Builder from(ExtensionDefinition instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.meta.ExtensionDefinition 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 Extension Definition object.") public final ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 extension definition.") public final ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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
    • name

      @CanIgnoreReturnValue @JsonPropertyDescription("The name of this extension.") public final ExtensionDefinitionObject.Builder name(String name)
      Initializes the value for the name attribute.
      Parameters:
      name - The value for name (can be null)
      Returns:
      this builder for use in a chained invocation
    • description

      @CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder description(String description)
      Initializes the optional value description to description.
      Parameters:
      description - The value for description
      Returns:
      this builder for chained invocation
    • description

      @CanIgnoreReturnValue @JsonPropertyDescription("A detailed description of this extension.") public final ExtensionDefinitionObject.Builder description(Optional<String> description)
      Initializes the optional value description to description.
      Parameters:
      description - The value for description
      Returns:
      this builder for use in a chained invocation
    • putSchema

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

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

      @CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addExtensionType(@Nullable String element)
      Adds one element to extensionTypes set.
      Parameters:
      element - A extensionTypes element
      Returns:
      this builder for use in a chained invocation
    • addExtensionTypes

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

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

      @CanIgnoreReturnValue public final ExtensionDefinitionObject.Builder addExtensionProperty(@Nullable String element)
      Adds one element to extensionProperties set.
      Parameters:
      element - A extensionProperties element
      Returns:
      this builder for use in a chained invocation
    • addExtensionProperties

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

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

      @CanIgnoreReturnValue public final ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject.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 ExtensionDefinitionObject build()
      Returns:
      An immutable instance of ExtensionDefinition
      Throws:
      IllegalStateException - if any required attributes are missing