Class ShardedKey<K>


  • public class ShardedKey<K>
    extends java.lang.Object
    A sharded key consisting of a user key and an opaque shard id represented by bytes.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ShardedKey.Coder<K>  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ShardedKey​(K key, byte[] shardId)  
    • Constructor Detail

      • ShardedKey

        protected ShardedKey​(K key,
                             byte[] shardId)
    • Method Detail

      • of

        public static <K> ShardedKey<K> of​(K key,
                                           byte[] shardId)
        Creates a ShardedKey with given key and shard id. Shard id must not be null and must not be mutated.
      • getKey

        public K getKey()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object