Class EmailMessage

java.lang.Object
security.whisper.javastix.coo.objects.EmailMessage
All Implemented Interfaces:
Serializable, BundleableObject, Stix, StixCustomProperties, CyberObservableObject, CyberObservableObjectCommonProperties, EmailMessageCoo, GenericValidation, SdoDefaultValidator

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class EmailMessage extends Object implements EmailMessageCoo
The Email Message Object represents an instance of an email message.
See Also:
  • Method Details

    • isMultipart

      @JsonPropertyDescription("Indicates whether the email body contains multiple MIME parts.") public Boolean isMultipart()
      Specified by:
      isMultipart in interface EmailMessageCoo
      Returns:
      The value of the isMultipart attribute
    • getDate

      @JsonPropertyDescription("Specifies the date/time that the email message was sent.") public Optional<StixInstant> getDate()
      Specified by:
      getDate in interface EmailMessageCoo
      Returns:
      The value of the date attribute
    • getContentType

      @JsonPropertyDescription("Specifies the value of the \'Content-Type\' header of the email message.") public Optional<String> getContentType()
      Specified by:
      getContentType in interface EmailMessageCoo
      Returns:
      The value of the contentType attribute
    • getFromRef

      @JsonPropertyDescription("Specifies the value of the \'From:\' header of the email message.") public Optional<String> getFromRef()
      Specified by:
      getFromRef in interface EmailMessageCoo
      Returns:
      The value of the fromRef attribute
    • getSenderRef

      @JsonPropertyDescription("Specifies the value of the \'From\' field of the email message") public Optional<String> getSenderRef()
      Specified by:
      getSenderRef in interface EmailMessageCoo
      Returns:
      The value of the senderRef attribute
    • getId

      public String getId()
      Deterministically generates the ID for this email message based on its subject, from, date, and content.
      Specified by:
      getId in interface BundleableObject
      Specified by:
      getId in interface CyberObservableObjectCommonProperties
      Specified by:
      getId in interface EmailMessageCoo
    • getType

      public String getType()
      Specified by:
      getType in interface BundleableObject
      Specified by:
      getType in interface CyberObservableObjectCommonProperties
      Returns:
      The value of the type attribute
    • getExtensions

      @JsonPropertyDescription("Specifies any extensions of the object, as a dictionary.") public com.google.common.collect.ImmutableSet<CyberObservableExtension> getExtensions()
      Multiple extensions can be added, but only 1 instance of a specific extension can be added.
      Specified by:
      getExtensions in interface CyberObservableObjectCommonProperties
    • getObservableObjectKey

      public String getObservableObjectKey()
      Used for generation of Map Keys by
      invalid reference
      ObservedDataSdo#getObjects()
      Manually set this value if you want to control key names. Otherwise UUIDs will be used.
      Specified by:
      getObservableObjectKey in interface CyberObservableObjectCommonProperties
    • getDefanged

      @JsonPropertyDescription("Indicates whether the data contained in the SCO has been defanged.") public Optional<Boolean> getDefanged()
      Indicates whether the data contained in the SCO has been defanged. Defanging refers to the process of modifying data to make it safe to handle (e.g., changing an IP address from 192.168.1.1 to 192[.]168[.]1[.]1).
      Specified by:
      getDefanged in interface CyberObservableObjectCommonProperties
    • 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>
    • getObjectMarkingRefs

      public com.google.common.collect.ImmutableSet<MarkingDefinitionDm> getObjectMarkingRefs()
      Specified by:
      getObjectMarkingRefs in interface BundleableObject
      Returns:
      The value of the objectMarkingRefs attribute
    • getGranularMarkings

      public com.google.common.collect.ImmutableSet<GranularMarkingDm> getGranularMarkings()
      Specified by:
      getGranularMarkings in interface BundleableObject
      Returns:
      The value of the granularMarkings attribute
    • getHydrated

      public boolean getHydrated()
      Specified by:
      getHydrated in interface BundleableObject
      Returns:
      The value of the hydrated attribute
    • toJsonString

      public String toJsonString()
      Specified by:
      toJsonString in interface BundleableObject
      Returns:
      The value of the toJsonString attribute
    • withIsMultipart

      public final EmailMessage withIsMultipart(Boolean value)
      Copy the current immutable object by setting a value for the isMultipart attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for isMultipart (can be null)
      Returns:
      A modified copy of the this object
    • withDate

      public final EmailMessage withDate(StixInstant value)
      Copy the current immutable object by setting a present value for the optional date attribute.
      Parameters:
      value - The value for date
      Returns:
      A modified copy of this object
    • withDate

      public final EmailMessage withDate(Optional<? extends StixInstant> optional)
      Copy the current immutable object by setting an optional value for the date attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for date
      Returns:
      A modified copy of this object
    • withContentType

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

      public final EmailMessage withContentType(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the contentType 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 contentType
      Returns:
      A modified copy of this object
    • withFromRef

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

      public final EmailMessage withFromRef(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the fromRef 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 fromRef
      Returns:
      A modified copy of this object
    • withSenderRef

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

      public final EmailMessage withSenderRef(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the senderRef 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 senderRef
      Returns:
      A modified copy of this object
    • withType

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

      public final EmailMessage withExtensions(CyberObservableExtension... elements)
      Copy the current immutable object with elements that replace the content of extensions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withExtensions

      public final EmailMessage withExtensions(Iterable<? extends CyberObservableExtension> elements)
      Copy the current immutable object with elements that replace the content of extensions. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of extensions elements to set
      Returns:
      A modified copy of this object
    • withObservableObjectKey

      public final EmailMessage withObservableObjectKey(String value)
      Copy the current immutable object by setting a value for the observableObjectKey attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for observableObjectKey
      Returns:
      A modified copy of the this object
    • withDefanged

      public final EmailMessage withDefanged(boolean value)
      Copy the current immutable object by setting a present value for the optional defanged attribute.
      Parameters:
      value - The value for defanged
      Returns:
      A modified copy of this object
    • withDefanged

      public final EmailMessage withDefanged(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the defanged 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 defanged
      Returns:
      A modified copy of this object
    • withCustomProperties

      public final EmailMessage 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
    • withObjectMarkingRefs

      public final EmailMessage withObjectMarkingRefs(MarkingDefinitionDm... elements)
      Copy the current immutable object with elements that replace the content of objectMarkingRefs.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withObjectMarkingRefs

      public final EmailMessage withObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements)
      Copy the current immutable object with elements that replace the content of objectMarkingRefs. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of objectMarkingRefs elements to set
      Returns:
      A modified copy of this object
    • withGranularMarkings

      public final EmailMessage withGranularMarkings(GranularMarkingDm... elements)
      Copy the current immutable object with elements that replace the content of granularMarkings.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withGranularMarkings

      public final EmailMessage withGranularMarkings(Iterable<? extends GranularMarkingDm> elements)
      Copy the current immutable object with elements that replace the content of granularMarkings. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of granularMarkings elements to set
      Returns:
      A modified copy of this object
    • withHydrated

      public final EmailMessage withHydrated(boolean value)
      Copy the current immutable object by setting a value for the hydrated attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for hydrated
      Returns:
      A modified copy of the this object
    • withToJsonString

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of EmailMessage 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: isMultipart, date, contentType, fromRef, senderRef, id, type, extensions, observableObjectKey, defanged, customProperties, objectMarkingRefs, granularMarkings, hydrated, toJsonString.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static EmailMessage copyOf(EmailMessageCoo instance)
      Creates an immutable copy of a EmailMessageCoo 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 EmailMessage instance
    • builder

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