Class MimePartType.Builder

java.lang.Object
security.whisper.javastix.coo.types.MimePartType.Builder
Enclosing class:
MimePartType

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

      @CanIgnoreReturnValue public final MimePartType.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
    • body

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the contents of the MIME part if the content_type is not provided OR starts with text/") public final MimePartType.Builder body(Optional<String> body)
      Initializes the optional value body to body.
      Parameters:
      body - The value for body
      Returns:
      this builder for use in a chained invocation
    • bodyRawRef

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the contents of non-textual MIME parts, that is those whose content_type does not start with text/") public final MimePartType.Builder bodyRawRef(Optional<String> bodyRawRef)
      Initializes the optional value bodyRawRef to bodyRawRef.
      Parameters:
      bodyRawRef - The value for bodyRawRef
      Returns:
      this builder for use in a chained invocation
    • contentType

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the value of the \'Content-Type\' header field of the MIME part.") public final MimePartType.Builder contentType(Optional<String> contentType)
      Initializes the optional value contentType to contentType.
      Parameters:
      contentType - The value for contentType
      Returns:
      this builder for use in a chained invocation
    • contentDisposition

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the value of the \'Content-Disposition\' header field of the MIME part.") public final MimePartType.Builder contentDisposition(Optional<String> contentDisposition)
      Initializes the optional value contentDisposition to contentDisposition.
      Parameters:
      contentDisposition - The value for contentDisposition
      Returns:
      this builder for use in a chained invocation
    • putCustomProperty

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