Class Type<T>

java.lang.Object
com.terracottatech.store.Type<T>

public final class Type<T> extends Object
The representation of a Terracotta Store type.
  • Field Details

  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getJDKType

      public Class<T> getJDKType()
      Returns the corresponding JDK type for this Terracotta Store type.
      Returns:
      the JDK type
    • asEnum

      public Type.Enum asEnum()
    • forJdkType

      public static <T> Type<T> forJdkType(Class<? extends T> clazz)
      Return the Terracotta Store type corresponding to the supplied JDK type.

      If there is no type corresponding to the supplied JDK type then null will be returned.

      Type Parameters:
      T - JDK type corresponding to the Terracotta Store type
      Parameters:
      clazz - a JDK type
      Returns:
      the corresponding Terracotta Store type
    • fromOrdinal

      public static Type<?> fromOrdinal(int ordinal)
    • equals

      public static boolean equals(Object a, Object b)
      Compares two cell values for equality.

      Cell value equality follows conventional Java behavior, except for BYTES cells which are compared using Arrays.equals(byte[], byte[]).

      Parameters:
      a - first cell value
      b - second cell value
      Returns:
      true if the cell values are equal
    • uncheckedEquals

      public static boolean uncheckedEquals(Object a, Object b)
      Compares two cell values for equality without checking for null or type-system support. Callers of this method are responsible for assuring the values are of a supported Type. Results are undefined for values not of a supported Type.
      Parameters:
      a - first cell value
      b - second cell value
      Returns:
      true if the cell values are equal
    • hashCode

      public static int hashCode(Object a)
      Return a hash code value consistent with equals(Object, Object).
      Parameters:
      a - the value of a supported Type for which the hash code is determined
      Returns:
      the hash code of a
    • uncheckedHashCode

      public static int uncheckedHashCode(Object a)
      Return a hash code value consistent with uncheckedEquals(Object, Object) without checking for null or type-system support. Callers of this method are responsible for assuring the value is of a supported Type. Results are undefined for values not of a supported Type.
      Parameters:
      a - the value for which the hash code is determined
      Returns:
      the hash code of a
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object