Class FormatKey<T>

java.lang.Object
org.monte.media.av.FormatKey<T>
All Implemented Interfaces:
Serializable, Comparable<FormatKey<T>>

public class FormatKey<T> extends Object implements Serializable, Comparable<FormatKey<T>>
A FormatKey provides type-safe access to an attribute of a Format.

A format key has a name, a type and a value.

Author:
Werner Randelshofer
See Also:
  • Field Details

  • Constructor Details

    • FormatKey

      public FormatKey(String key, Class<T> clazz)
      Creates a new instance with the specified attribute key, type token class, default value null, and allowing null values.
    • FormatKey

      public FormatKey(String key, String name, Class<T> clazz)
      Creates a new instance with the specified attribute key, type token class, default value null, and allowing null values.
    • FormatKey

      public FormatKey(String key, String name, Class<T> clazz, boolean comment)
      Creates a new instance with the specified attribute key, type token class, default value null, and whether the key is just a comment.
  • Method Details

    • getKey

      public String getKey()
      Returns the key string.
      Returns:
      key string.
    • getName

      public String getName()
      Returns the pretty name string.
      Returns:
      name string.
    • toString

      public String toString()
      Returns the key string.
      Overrides:
      toString in class Object
    • isAssignable

      public boolean isAssignable(Object value)
      Returns true if the specified value is assignable with this key.
      Parameters:
      value -
      Returns:
      True if assignable.
    • isComment

      public boolean isComment()
    • getValueClass

      public Class<T> getValueClass()
    • compareTo

      public int compareTo(FormatKey<T> that)
      Specified by:
      compareTo in interface Comparable<T>