Class ContentType.Builder

java.lang.Object
ch.raffael.meldioc.library.codec.ContentType.Builder
Enclosing class:
ContentType

public static final class ContentType.Builder extends Object
  • Method Details

    • from

      public final ContentType.Builder from(ContentType instance)
      Fill a builder with attribute values from the provided ContentType instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • type

      public final ContentType.Builder type(String type)
      Initializes the value for the type attribute.
      Parameters:
      type - The value for type
      Returns:
      this builder for use in a chained invocation
    • subtype

      public final ContentType.Builder subtype(String subtype)
      Initializes the value for the subtype attribute.
      Parameters:
      subtype - The value for subtype
      Returns:
      this builder for use in a chained invocation
    • putAttributes

      public ContentType.Builder putAttributes(String key, String value)
    • putEntryAttributes

      public ContentType.Builder putEntryAttributes(io.vavr.Tuple2<String,String> entry)
    • attributes

      public ContentType.Builder attributes(io.vavr.collection.Map<String,String> elements)
    • setJavaMapAttributes

      public ContentType.Builder setJavaMapAttributes(Map<String,String> in_map)
    • setEntriesAttributes

      public ContentType.Builder setEntriesAttributes(Iterable<io.vavr.Tuple2<String,String>> entries)
    • build

      public ContentType build()
      Builds a new ContentType.
      Returns:
      An immutable instance of ContentType
      Throws:
      ch.raffael.meldioc.util.immutables.IllegalBuilderStateException - if any required attributes are missing