Class BinaryFormatter<K>

  • All Implemented Interfaces:
    Formatter<K>

    public class BinaryFormatter<K>
    extends Object
    implements Formatter<K>
    Formatter implementation for binary keys.
    Author:
    Paul Ferraro
    • Constructor Detail

      • BinaryFormatter

        public BinaryFormatter​(Class<K> targetClass,
                               Serializer<K> serializer)
    • Method Detail

      • getTargetClass

        public Class<K> getTargetClass()
        Description copied from interface: Formatter
        The implementation class of the target key of this format.
        Specified by:
        getTargetClass in interface Formatter<K>
        Returns:
        an implementation class
      • parse

        public K parse​(String value)
        Description copied from interface: Formatter
        Parses the key from the specified string.
        Specified by:
        parse in interface Formatter<K>
        Parameters:
        value - a string representation of the key
        Returns:
        the parsed key
      • format

        public String format​(K key)
        Description copied from interface: Formatter
        Formats the specified key to a string representation.
        Specified by:
        format in interface Formatter<K>
        Parameters:
        key - a key to format
        Returns:
        a string representation of the specified key.