Class ExternalReference

java.lang.Object
security.whisper.javastix.sdo.types.ExternalReference
All Implemented Interfaces:
Serializable, StixCustomProperties, ExternalReferenceType, GenericValidation, SdoDefaultValidator

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ExternalReference extends Object implements ExternalReferenceType
external-reference

External references are used to describe pointers to information represented outside of STIX.

See Also:
  • Method Details

    • getSourceName

      @JsonPropertyDescription("The source within which the external-reference is defined (system, registry, organization, etc.)") public String getSourceName()
      Specified by:
      getSourceName in interface ExternalReferenceType
      Returns:
      The value of the sourceName attribute
    • getDescription

      @JsonPropertyDescription("A human readable description") public Optional<String> getDescription()
      Specified by:
      getDescription in interface ExternalReferenceType
      Returns:
      The value of the description attribute
    • getUrl

      @JsonPropertyDescription("Matches the elements of a URL using a regular expression. Uses Diego Perini\'s regex from https://gist.github.com/dperini/729294.") public Optional<String> getUrl()
      Specified by:
      getUrl in interface ExternalReferenceType
      Returns:
      The value of the url attribute
    • getHashes

      @JsonPropertyDescription("Specifies a dictionary of hashes for the file.") public com.google.common.collect.ImmutableMap<String,String> getHashes()
      Specified by:
      getHashes in interface ExternalReferenceType
      Returns:
      The value of the hashes attribute
    • getExternalId

      @JsonPropertyDescription("An identifier for the external reference content") public Optional<String> getExternalId()
      Specified by:
      getExternalId in interface ExternalReferenceType
      Returns:
      The value of the externalId attribute
    • getCustomProperties

      public com.google.common.collect.ImmutableMap<String,Object> getCustomProperties()
      Custom Properties for STIX Objects. Any object that supports custom properties will have a validation of the custom property prefix (typically "x_"). If the additional property in the JSON does not meet the StartsWith condition, then the JSON will be rejected.
      Specified by:
      getCustomProperties in interface StixCustomProperties
      Returns:
      Map of custom properties Map<String, Object>
    • withSourceName

      public final ExternalReference withSourceName(String value)
      Copy the current immutable object by setting a value for the sourceName attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for sourceName (can be null)
      Returns:
      A modified copy of the this object
    • withDescription

      public final ExternalReference withDescription(String value)
      Copy the current immutable object by setting a present value for the optional description attribute.
      Parameters:
      value - The value for description
      Returns:
      A modified copy of this object
    • withDescription

      public final ExternalReference withDescription(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the description attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for description
      Returns:
      A modified copy of this object
    • withUrl

      public final ExternalReference withUrl(String value)
      Copy the current immutable object by setting a present value for the optional url attribute.
      Parameters:
      value - The value for url
      Returns:
      A modified copy of this object
    • withUrl

      public final ExternalReference withUrl(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the url attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for url
      Returns:
      A modified copy of this object
    • withHashes

      public final ExternalReference withHashes(Map<String,? extends String> entries)
      Copy the current immutable object by replacing the hashes map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the hashes map
      Returns:
      A modified copy of this object
    • withExternalId

      public final ExternalReference withExternalId(String value)
      Copy the current immutable object by setting a present value for the optional externalId attribute.
      Parameters:
      value - The value for externalId
      Returns:
      A modified copy of this object
    • withExternalId

      public final ExternalReference withExternalId(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the externalId attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for externalId
      Returns:
      A modified copy of this object
    • withCustomProperties

      public final ExternalReference withCustomProperties(Map<String,? extends Object> entries)
      Copy the current immutable object by replacing the customProperties map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the customProperties map
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ExternalReference that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: sourceName, description, url, hashes, externalId, customProperties.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value ExternalReference with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ExternalReference copyOf(ExternalReferenceType instance)
      Creates an immutable copy of a ExternalReferenceType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable ExternalReference instance
    • builder

      public static ExternalReference.Builder builder()
      Creates a builder for ExternalReference.
      Returns:
      A new ExternalReference builder