Package com.io7m.smfj.core
Class SMFFormatDescription
- java.lang.Object
-
- com.io7m.smfj.core.SMFFormatDescription
-
- All Implemented Interfaces:
SMFFormatDescriptionType
public final class SMFFormatDescription extends java.lang.Object implements SMFFormatDescriptionType
A description of a format.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SMFFormatDescription.Builder
Builds instances of typeSMFFormatDescription
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SMFFormatDescription.Builder
builder()
Creates a builder forSMFFormatDescription
.static SMFFormatDescription
copyOf(SMFFormatDescriptionType instance)
Creates an immutable copy of aSMFFormatDescriptionType
value.java.lang.String
description()
boolean
equals(java.lang.Object another)
This instance is equal to all instances ofSMFFormatDescription
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:description
,suffix
,mimeType
,name
,randomAccess
.java.lang.String
mimeType()
java.lang.String
name()
boolean
randomAccess()
java.lang.String
suffix()
java.lang.String
toString()
Prints the immutable valueSMFFormatDescription
with attribute values.SMFFormatDescription
withDescription(java.lang.String value)
Copy the current immutable object by setting a value for thedescription
attribute.SMFFormatDescription
withMimeType(java.lang.String value)
Copy the current immutable object by setting a value for themimeType
attribute.SMFFormatDescription
withName(java.lang.String value)
Copy the current immutable object by setting a value for thename
attribute.SMFFormatDescription
withRandomAccess(boolean value)
Copy the current immutable object by setting a value for therandomAccess
attribute.SMFFormatDescription
withSuffix(java.lang.String value)
Copy the current immutable object by setting a value for thesuffix
attribute.
-
-
-
Method Detail
-
description
public java.lang.String description()
- Specified by:
description
in interfaceSMFFormatDescriptionType
- Returns:
- A human-readable description of the format
-
suffix
public java.lang.String suffix()
- Specified by:
suffix
in interfaceSMFFormatDescriptionType
- Returns:
- The filename suffix used for the format
-
mimeType
public java.lang.String mimeType()
- Specified by:
mimeType
in interfaceSMFFormatDescriptionType
- Returns:
- The mime type for the format
-
name
public java.lang.String name()
- Specified by:
name
in interfaceSMFFormatDescriptionType
- Returns:
- The unique name for the format
-
randomAccess
public boolean randomAccess()
- Specified by:
randomAccess
in interfaceSMFFormatDescriptionType
- Returns:
true
iff the format supports random access
-
withDescription
public final SMFFormatDescription withDescription(java.lang.String value)
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
-
withSuffix
public final SMFFormatDescription withSuffix(java.lang.String value)
Copy the current immutable object by setting a value for thesuffix
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for suffix- Returns:
- A modified copy of the
this
object
-
withMimeType
public final SMFFormatDescription withMimeType(java.lang.String value)
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
public final SMFFormatDescription withName(java.lang.String value)
Copy the current immutable object by setting a value for thename
attribute. An equals check 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
-
withRandomAccess
public final SMFFormatDescription withRandomAccess(boolean value)
Copy the current immutable object by setting a value for therandomAccess
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for randomAccess- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofSMFFormatDescription
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
,suffix
,mimeType
,name
,randomAccess
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueSMFFormatDescription
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
copyOf
public static SMFFormatDescription copyOf(SMFFormatDescriptionType instance)
Creates an immutable copy of aSMFFormatDescriptionType
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 SMFFormatDescription instance
-
builder
public static SMFFormatDescription.Builder builder()
Creates a builder forSMFFormatDescription
.SMFFormatDescription.builder() .setDescription(String) // required
description
.setSuffix(String) // requiredsuffix
.setMimeType(String) // requiredmimeType
.setName(String) // requiredname
.setRandomAccess(boolean) // requiredrandomAccess
.build();- Returns:
- A new SMFFormatDescription builder
-
-