Interface RowKeyValueConverter<K,​V>

  • All Known Implementing Classes:
    DefaultRowKeyValueConverter

    public interface RowKeyValueConverter<K,​V>
    Interface to allow custom application-specific Java classes to be used to represent keys and values instead of the default String (for keys) and RowValue classes.

    To fulfil the contract of ConcurrentMap it is essential that all key and value objects have valid implementations of equals() and hashCode().

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      V fromRowValue​(RowValue value)
      Converts a RowValue object to the custom application-specific object that should be used for values in this table.
      K fromStringKey​(java.lang.String key)
      Converts a string to the application-specific object that should be used for keys in this table.
      RowValue toRowValue​(V value)
      Converts an application-specific row value object to a RowValue.
      java.lang.String toStringKey​(K key)
      Converts an application-specific key object to a string.
    • Method Detail

      • fromRowValue

        V fromRowValue​(RowValue value)
        Converts a RowValue object to the custom application-specific object that should be used for values in this table.
        Parameters:
        value - the row value to convert
        Returns:
        must be null if value is null
      • toRowValue

        RowValue toRowValue​(V value)
        Converts an application-specific row value object to a RowValue.
        Parameters:
        value - the row value to convert
        Returns:
        must be null if value is null
      • fromStringKey

        K fromStringKey​(java.lang.String key)
        Converts a string to the application-specific object that should be used for keys in this table.

        Most maps use String or Object so there is usually nothing to do but a cast.

        Parameters:
        key - the string representation of the key
        Returns:
        application-specific object representing the key
      • toStringKey

        java.lang.String toStringKey​(K key)
        Converts an application-specific key object to a string.

        If the map is keyed by strings, this should simply return the argument cast to a String.

        Parameters:
        key - the key to convert
        Returns:
        String representation of the key; must return null if input key is null