Class Key

    • Constructor Detail

      • Key

        protected Key​(long hash)
    • Method Detail

      • hash

        public long hash()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public abstract boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • of

        public static Key of​(String key,
                             ApplicationId appId)
        Creates a key based on the provided string.

        Note: Two keys with equal value, but different appId, are not equal. Warning: it is caller responsibility to make sure the hashed value of value is unique.

        Parameters:
        key - the provided string
        appId - application id to associate with this key
        Returns:
        the key for the string
      • of

        public static Key of​(long key,
                             ApplicationId appId)
        Creates a key based on the provided long.

        Note: Two keys with equal value, but different appId, are not equal. Also, "10" and 10L are different.

        Parameters:
        key - the provided long
        appId - application id to associate with this key
        Returns:
        the key for the long