Class FormatDescription
java.lang.Object
com.io7m.coffeepick.runtime.parser.spi.FormatDescription
- All Implemented Interfaces:
FormatDescriptionType
public final class FormatDescription extends java.lang.Object implements FormatDescriptionType
A runtimes of a supported format.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FormatDescription.Builder
Builds instances of typeFormatDescription
. -
Method Summary
Modifier and Type Method Description static FormatDescription.Builder
builder()
Creates a builder forFormatDescription
.static FormatDescription
copyOf(FormatDescriptionType instance)
Creates an immutable copy of aFormatDescriptionType
value.java.lang.String
description()
boolean
equals(java.lang.Object another)
This instance is equal to all instances ofFormatDescription
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:description
,mimeType
,name
.java.lang.String
mimeType()
java.net.URI
name()
java.lang.String
toString()
Prints the immutable valueFormatDescription
with attribute values.FormatDescription
withDescription(java.lang.String value)
Copy the current immutable object by setting a value for thedescription
attribute.FormatDescription
withMimeType(java.lang.String value)
Copy the current immutable object by setting a value for themimeType
attribute.FormatDescription
withName(java.net.URI value)
Copy the current immutable object by setting a value for thename
attribute.
-
Method Details
-
description
public java.lang.String description()- Specified by:
description
in interfaceFormatDescriptionType
- Returns:
- A human-readable runtimes of the format
-
mimeType
public java.lang.String mimeType()- Specified by:
mimeType
in interfaceFormatDescriptionType
- Returns:
- The mime type for the format
-
name
public java.net.URI name()- Specified by:
name
in interfaceFormatDescriptionType
- Returns:
- The unique name for the format
-
withDescription
Copy the current immutable object by setting a value for thedescription
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for description- Returns:
- A modified copy of the
this
object
-
withMimeType
Copy the current immutable object by setting a value for themimeType
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for mimeType- Returns:
- A modified copy of the
this
object
-
withName
Copy the current immutable object by setting a value for thename
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for name- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofFormatDescription
that have equal attribute values.- Overrides:
equals
in classjava.lang.Object
- Returns:
true
ifthis
is equal toanother
instance
-
hashCode
public int hashCode()Computes a hash code from attributes:description
,mimeType
,name
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueFormatDescription
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aFormatDescriptionType
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 FormatDescription instance
-
builder
Creates a builder forFormatDescription
.FormatDescription.builder() .setDescription(String) // required
description
.setMimeType(String) // requiredmimeType
.setName(java.net.URI) // requiredname
.build();- Returns:
- A new FormatDescription builder
-