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.
  • Method Details

    • description

      public java.lang.String description()
      Specified by:
      description in interface FormatDescriptionType
      Returns:
      A human-readable runtimes of the format
    • mimeType

      public java.lang.String mimeType()
      Specified by:
      mimeType in interface FormatDescriptionType
      Returns:
      The mime type for the format
    • name

      public java.net.URI name()
      Specified by:
      name in interface FormatDescriptionType
      Returns:
      The unique name for the format
    • withDescription

      public final FormatDescription withDescription​(java.lang.String value)
      Copy the current immutable object by setting a value for the description attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for description
      Returns:
      A modified copy of the this object
    • withMimeType

      public final FormatDescription withMimeType​(java.lang.String value)
      Copy the current immutable object by setting a value for the mimeType attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for mimeType
      Returns:
      A modified copy of the this object
    • withName

      public final FormatDescription withName​(java.net.URI value)
      Copy the current immutable object by setting a value for the name attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      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 of FormatDescription that have equal attribute values.
      Overrides:
      equals in class java.lang.Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: description, mimeType, name.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      hashCode value
    • toString

      public java.lang.String toString()
      Prints the immutable value FormatDescription with attribute values.
      Overrides:
      toString in class java.lang.Object
      Returns:
      A string representation of the value
    • copyOf

      public static FormatDescription copyOf​(FormatDescriptionType instance)
      Creates an immutable copy of a FormatDescriptionType 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

      public static FormatDescription.Builder builder()
      Creates a builder for FormatDescription.
       FormatDescription.builder()
          .setDescription(String) // required description
          .setMimeType(String) // required mimeType
          .setName(java.net.URI) // required name
          .build();
       
      Returns:
      A new FormatDescription builder