Package ch.raffael.meldioc.library.codec
Class ContentType.Builder
java.lang.Object
ch.raffael.meldioc.library.codec.ContentType.Builder
- Enclosing class:
ContentType
-
Method Summary
Modifier and TypeMethodDescriptionattributes(io.vavr.collection.Map<String, String> elements) build()Builds a newContentType.final ContentType.Builderfrom(ContentType instance) Fill a builder with attribute values from the providedContentTypeinstance.putAttributes(String key, String value) putEntryAttributes(io.vavr.Tuple2<String, String> entry) setEntriesAttributes(Iterable<io.vavr.Tuple2<String, String>> entries) setJavaMapAttributes(Map<String, String> in_map) final ContentType.BuilderInitializes the value for thesubtypeattribute.final ContentType.BuilderInitializes the value for thetypeattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedContentTypeinstance. 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:
thisbuilder for use in a chained invocation
-
type
Initializes the value for thetypeattribute.- Parameters:
type- The value for type- Returns:
thisbuilder for use in a chained invocation
-
subtype
Initializes the value for thesubtypeattribute.- Parameters:
subtype- The value for subtype- Returns:
thisbuilder for use in a chained invocation
-
putAttributes
-
putEntryAttributes
-
attributes
-
setJavaMapAttributes
-
setEntriesAttributes
-
build
Builds a newContentType.- Returns:
- An immutable instance of ContentType
- Throws:
ch.raffael.meldioc.util.immutables.IllegalBuilderStateException- if any required attributes are missing
-