Class Indicator.Builder

java.lang.Object
security.whisper.javastix.sdo.objects.Indicator.Builder
Enclosing class:
Indicator

@NotThreadSafe public static final class Indicator.Builder extends Object
Builds instances of type Indicator. 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 Indicator.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 Indicator.Builder from(StixCommonProperties instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.common.StixCommonProperties instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

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

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

      @CanIgnoreReturnValue public final Indicator.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 Indicator.Builder from(StixLabels instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.common.StixLabels instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

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

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

      @CanIgnoreReturnValue public final Indicator.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 Indicator.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("This field is an Open Vocabulary that specifies the type of indicator. Open vocab - indicator-label-ov") public final Indicator.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 Indicator.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
    • addIndicatorType

      @CanIgnoreReturnValue public final Indicator.Builder addIndicatorType(@Nullable String element)
      Adds one element to indicatorTypes set.
      Parameters:
      element - A indicatorTypes element
      Returns:
      this builder for use in a chained invocation
    • addIndicatorTypes

      @CanIgnoreReturnValue public final Indicator.Builder addIndicatorTypes(String... elements)
      Adds elements to indicatorTypes set.
      Parameters:
      elements - An array of indicatorTypes elements
      Returns:
      this builder for use in a chained invocation
    • indicatorTypes

      @CanIgnoreReturnValue @JsonPropertyDescription("This field is an Open Vocabulary that specifies the type of indicator. Open vocab - indicator-type-ov") public final Indicator.Builder indicatorTypes(Iterable<String> elements)
      Sets or replaces all elements for indicatorTypes set.
      Parameters:
      elements - An iterable of indicatorTypes elements
      Returns:
      this builder for use in a chained invocation
    • addAllIndicatorTypes

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

      @CanIgnoreReturnValue public final Indicator.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("This field identifies the confidence that the creator has in the correctness of their data. The value ranges from 0 (no confidence) to 100 (complete confidence).") public final Indicator.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
    • name

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

      @CanIgnoreReturnValue @JsonPropertyDescription("The name used to identify the Indicator.") public final Indicator.Builder name(Optional<String> name)
      Initializes the optional value name to name.
      Parameters:
      name - The value for name
      Returns:
      this builder for use in a chained invocation
    • description

      @CanIgnoreReturnValue public final Indicator.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 description that provides more details and context about this Indicator, potentially including its purpose and its key characteristics.") public final Indicator.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
    • pattern

      @CanIgnoreReturnValue @JsonPropertyDescription("The detection pattern for this indicator. The default language is STIX Patterning.") public final Indicator.Builder pattern(String pattern)
      Initializes the value for the pattern attribute.
      Parameters:
      pattern - The value for pattern (can be null)
      Returns:
      this builder for use in a chained invocation
    • patternType

      @CanIgnoreReturnValue @JsonPropertyDescription("The pattern language used in this indicator. The default is \'stix\' which represents STIX Patterning.") public final Indicator.Builder patternType(String patternType)
      Initializes the value for the patternType attribute.

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

      Parameters:
      patternType - The value for patternType
      Returns:
      this builder for use in a chained invocation
    • validFrom

      @CanIgnoreReturnValue @JsonPropertyDescription("The time from which this indicator should be considered valuable intelligence.") public final Indicator.Builder validFrom(StixInstant validFrom)
      Initializes the value for the validFrom attribute.
      Parameters:
      validFrom - The value for validFrom (can be null)
      Returns:
      this builder for use in a chained invocation
    • validUntil

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

      @CanIgnoreReturnValue @JsonPropertyDescription("The time at which this indicator should no longer be considered valuable intelligence.") public final Indicator.Builder validUntil(Optional<? extends StixInstant> validUntil)
      Initializes the optional value validUntil to validUntil.
      Parameters:
      validUntil - The value for validUntil
      Returns:
      this builder for use in a chained invocation
    • addKillChainPhase

      @CanIgnoreReturnValue public final Indicator.Builder addKillChainPhase(@Nullable KillChainPhaseType element)
      Adds one element to killChainPhases set.
      Parameters:
      element - A killChainPhases element
      Returns:
      this builder for use in a chained invocation
    • addKillChainPhases

      @CanIgnoreReturnValue public final Indicator.Builder addKillChainPhases(KillChainPhaseType... elements)
      Adds elements to killChainPhases set.
      Parameters:
      elements - An array of killChainPhases elements
      Returns:
      this builder for use in a chained invocation
    • killChainPhases

      @CanIgnoreReturnValue @JsonPropertyDescription("The list of kill chain phases for which this attack pattern is used.") public final Indicator.Builder killChainPhases(Iterable<? extends KillChainPhaseType> elements)
      Sets or replaces all elements for killChainPhases set.
      Parameters:
      elements - An iterable of killChainPhases elements
      Returns:
      this builder for use in a chained invocation
    • addAllKillChainPhases

      @CanIgnoreReturnValue public final Indicator.Builder addAllKillChainPhases(Iterable<? extends KillChainPhaseType> elements)
      Adds elements to killChainPhases set.
      Parameters:
      elements - An iterable of killChainPhases elements
      Returns:
      this builder for use in a chained invocation
    • addRelationship

      @CanIgnoreReturnValue public final Indicator.Builder addRelationship(@Nullable RelationshipSro element)
      Adds one element to relationships set.
      Parameters:
      element - A relationships element
      Returns:
      this builder for use in a chained invocation
    • addRelationships

      @CanIgnoreReturnValue public final Indicator.Builder addRelationships(RelationshipSro... elements)
      Adds elements to relationships set.
      Parameters:
      elements - An array of relationships elements
      Returns:
      this builder for use in a chained invocation
    • relationships

      @CanIgnoreReturnValue public final Indicator.Builder relationships(Iterable<? extends RelationshipSro> elements)
      Sets or replaces all elements for relationships set.
      Parameters:
      elements - An iterable of relationships elements
      Returns:
      this builder for use in a chained invocation
    • addAllRelationships

      @CanIgnoreReturnValue public final Indicator.Builder addAllRelationships(Iterable<? extends RelationshipSro> elements)
      Adds elements to relationships set.
      Parameters:
      elements - An iterable of relationships elements
      Returns:
      this builder for use in a chained invocation
    • hydrated

      @CanIgnoreReturnValue public final Indicator.Builder hydrated(boolean hydrated)
      Initializes the value for the hydrated attribute.

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

      Parameters:
      hydrated - The value for hydrated
      Returns:
      this builder for use in a chained invocation
    • type

      @CanIgnoreReturnValue @JsonPropertyDescription("The type property identifies the type of STIX Object (SDO, Relationship Object, etc). The value of the type field MUST be one of the types defined by a STIX Object (e.g., indicator).") public final Indicator.Builder type(String type)
      Initializes the value for the type attribute.
      Parameters:
      type - The value for type (can be null)
      Returns:
      this builder for use in a chained invocation
    • id

      @CanIgnoreReturnValue @JsonPropertyDescription("Represents identifiers across the CTI specifications. The format consists of the name of the top-level object being identified, followed by two dashes (--), followed by a UUIDv4.") public final Indicator.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
    • createdByRef

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Represents identifiers across the CTI specifications. The format consists of the name of the top-level object being identified, followed by two dashes (--), followed by a UUIDv4.") public final Indicator.Builder createdByRef(Optional<? extends IdentitySdo> 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 the first version of this object was created. The timstamp value MUST be precise to the nearest millisecond.") public final Indicator.Builder created(StixInstant created)
      Initializes the value for the created attribute.

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

      Parameters:
      created - The value for created
      Returns:
      this builder for use in a chained invocation
    • lang

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Identifies the language of the text content in this object using ISO 639-2 language codes.") public final Indicator.Builder lang(Optional<String> lang)
      Initializes the optional value lang to lang.
      Parameters:
      lang - The value for lang
      Returns:
      this builder for use in a chained invocation
    • addExternalReference

      @CanIgnoreReturnValue public final Indicator.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 Indicator.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 refers to non-STIX information.") public final Indicator.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 Indicator.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 Indicator.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 Indicator.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 Indicator.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 Indicator.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 Indicator.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 Indicator.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 Indicator.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 Indicator.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
    • putCustomProperty

      @CanIgnoreReturnValue public final Indicator.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 Indicator.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 Indicator.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 Indicator.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
    • modified

      @CanIgnoreReturnValue @JsonPropertyDescription("The modified property represents the time that this particular version of the object was created. The timstamp value MUST be precise to the nearest millisecond.") public final Indicator.Builder modified(StixInstant modified)
      Initializes the value for the modified attribute.

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

      Parameters:
      modified - The value for modified
      Returns:
      this builder for use in a chained invocation
    • revoked

      @CanIgnoreReturnValue @JsonPropertyDescription("The revoked property indicates whether the object has been revoked.") public final Indicator.Builder revoked(StixBoolean revoked)
      Initializes the value for the revoked attribute.

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

      Parameters:
      revoked - The value for revoked
      Returns:
      this builder for use in a chained invocation
    • build

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