Class FormatDescription.Builder
java.lang.Object
com.io7m.coffeepick.runtime.parser.spi.FormatDescription.Builder
- Enclosing class:
- FormatDescription
public static final class FormatDescription.Builder
extends java.lang.Object
Builds instances of type
FormatDescription.
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 Summary
Modifier and Type Method Description FormatDescriptionbuild()Builds a newFormatDescription.FormatDescription.Builderfrom(FormatDescriptionType instance)Fill a builder with attribute values from the providedFormatDescriptionTypeinstance.FormatDescription.BuildersetDescription(java.lang.String description)Initializes the value for thedescriptionattribute.FormatDescription.BuildersetMimeType(java.lang.String mimeType)Initializes the value for themimeTypeattribute.FormatDescription.BuildersetName(java.net.URI name)Initializes the value for thenameattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedFormatDescriptionTypeinstance. 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
-
setDescription
Initializes the value for thedescriptionattribute.- Parameters:
description- The value for description- Returns:
thisbuilder for use in a chained invocation
-
setMimeType
Initializes the value for themimeTypeattribute.- Parameters:
mimeType- The value for mimeType- Returns:
thisbuilder for use in a chained invocation
-
setName
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newFormatDescription.- Returns:
- An immutable instance of FormatDescription
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-