Package com.terracottatech.store
Class Type<T>
java.lang.Object
com.terracottatech.store.Type<T>
The representation of a Terracotta Store type.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionasEnum()booleanstatic booleanCompares two cell values for equality.static <T> Type<T>forJdkType(Class<? extends T> clazz) Return the Terracotta Store type corresponding to the supplied JDK type.static Type<?>fromOrdinal(int ordinal) Returns the corresponding JDK type for this Terracotta Store type.inthashCode()static intReturn a hash code value consistent withequals(Object, Object).toString()static booleanuncheckedEquals(Object a, Object b) Compares two cell values for equality without checking fornullor type-system support.static intReturn a hash code value consistent withuncheckedEquals(Object, Object)without checking fornullor type-system support.
-
Field Details
-
Method Details
-
toString
-
getJDKType
Returns the corresponding JDK type for this Terracotta Store type.- Returns:
- the JDK type
-
asEnum
-
forJdkType
Return the Terracotta Store type corresponding to the supplied JDK type.If there is no type corresponding to the supplied JDK type then
nullwill 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
-
equals
Compares two cell values for equality.Cell value equality follows conventional Java behavior, except for
BYTEScells which are compared usingArrays.equals(byte[], byte[]).- Parameters:
a- first cell valueb- second cell value- Returns:
trueif the cell values are equal
-
uncheckedEquals
Compares two cell values for equality without checking fornullor type-system support. Callers of this method are responsible for assuring the values are of a supportedType. Results are undefined for values not of a supportedType.- Parameters:
a- first cell valueb- second cell value- Returns:
trueif the cell values are equal
-
hashCode
Return a hash code value consistent withequals(Object, Object).- Parameters:
a- the value of a supportedTypefor which the hash code is determined- Returns:
- the hash code of
a
-
uncheckedHashCode
Return a hash code value consistent withuncheckedEquals(Object, Object)without checking fornullor type-system support. Callers of this method are responsible for assuring the value is of a supportedType. Results are undefined for values not of a supportedType.- Parameters:
a- the value for which the hash code is determined- Returns:
- the hash code of
a
-
equals
-
hashCode
public int hashCode()
-