Interface NativeSourceData.KeySerde<K>

Type Parameters:
K - The native key type.
Enclosing class:
NativeSourceData<K extends Comparable<K>>

public static interface NativeSourceData.KeySerde<K>
A serializer / deserializer pair for a native key. The implementation must meet the contract:

 K k = ...
 k.compareTo(KeySerde.fromString(KeySerde.toString(k))) == 0
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Many storage implementations use String keys.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromString(String nativeKeyString)
    Creates a native key from a parsable string representation.
    toString(K nativeKey)
    Creates a parsable string representation of a native key.
  • Field Details

    • STRING_SERDE

      static final NativeSourceData.KeySerde<String> STRING_SERDE
      Many storage implementations use String keys. This implementation is to support those.
  • Method Details

    • toString

      String toString(K nativeKey)
      Creates a parsable string representation of a native key.
      Parameters:
      nativeKey - the native key.
      Returns:
      the string representation.
    • fromString

      K fromString(String nativeKeyString)
      Creates a native key from a parsable string representation.
      Parameters:
      nativeKeyString - the parsable string representation.
      Returns:
      the native key.