Class MimePartType

java.lang.Object
security.whisper.javastix.coo.types.MimePartType
All Implemented Interfaces:
Serializable, StixCustomProperties, MimePartTypeObj, GenericValidation, SdoDefaultValidator

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class MimePartType extends Object implements MimePartTypeObj
Specifies a component of a multi-part email body.
See Also:
  • Method Details

    • getBody

      @JsonPropertyDescription("Specifies the contents of the MIME part if the content_type is not provided OR starts with text/") public Optional<String> getBody()
      Contents of body MUST be decoded to Unicode.
      Specified by:
      getBody in interface MimePartTypeObj
    • getBodyRawRef

      @JsonPropertyDescription("Specifies the contents of non-textual MIME parts, that is those whose content_type does not start with text/") public Optional<String> getBodyRawRef()
      The object referenced in this property MUST be of type artifact or file. For use cases where conveying the actual data contained in the MIME part is of primary importance, artifact SHOULD be used. Otherwise, for use cases where conveying metadata about the file-like properties of the MIME part is of primary importance, file SHOULD be used.
      Specified by:
      getBodyRawRef in interface MimePartTypeObj
    • getContentType

      @JsonPropertyDescription("Specifies the value of the \'Content-Type\' header field of the MIME part.") public Optional<String> getContentType()
      Any additional “Content-Type” header field parameters such as charset SHOULD be included in this property.
      Specified by:
      getContentType in interface MimePartTypeObj
    • getContentDisposition

      @JsonPropertyDescription("Specifies the value of the \'Content-Disposition\' header field of the MIME part.") public Optional<String> getContentDisposition()
      Specified by:
      getContentDisposition in interface MimePartTypeObj
      Returns:
      The value of the contentDisposition 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>
    • withBody

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

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

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

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

      public final MimePartType 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 MimePartType 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
    • withContentDisposition

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

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

      public final MimePartType 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 MimePartType 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: body, bodyRawRef, contentType, contentDisposition, customProperties.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

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