Class ObjectKey<T>

    • Constructor Detail

      • ObjectKey

        public ObjectKey()
        Initializes the internal key value to null.
    • Method Detail

      • hashCode

        public int hashCode()
        Returns the hashcode of the underlying value (key), if key is not null. Otherwise calls Object.hashCode()
        Overrides:
        hashCode in class Object
        Returns:
        an int value
      • equals

        public boolean equals​(Object obj)
        Returns whether this ObjekctKey is equal to another Object. obj is equal to this ObjectKey if obj has the same class as this ObjectKey and contains the same information this key contains. Two ObjectKeys that both contain null values are not considered equal.
        Overrides:
        equals in class Object
        Parameters:
        obj - the comparison value.
        Returns:
        whether the two objects are equal.
      • getValue

        public T getValue()
        Get the underlying object.
        Returns:
        the underlying object
      • getJdbcType

        public abstract int getJdbcType()
        Returns the JDBC type of the key as defined in java.sql.Types.
        Returns:
        the JDBC type of the key.
      • appendTo

        public void appendTo​(StringBuilder sb)
        Appends a String representation of the key to a buffer.
        Parameters:
        sb - a StringBuilder
      • compareTo

        public int compareTo​(Object obj)
        Implements the compareTo method.
        Specified by:
        compareTo in interface Comparable<T>
        Parameters:
        obj - the object to compare to this object
        Returns:
        a numeric comparison of the two values
      • setValue

        public void setValue​(T key)
        Sets the internal representation.
        Parameters:
        key - the key value
      • setValue

        public <O extends ObjectKey<T>> void setValue​(O key)
        Sets the internal representation to the same object used by key.
        Type Parameters:
        O - the key type
        Parameters:
        key - the key value
      • toString

        public String toString()
        Get a String representation of this key.
        Overrides:
        toString in class Object
        Returns:
        a String representation of this key, or an empty String if the value is null.