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()
boolean
static boolean
Compares 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.int
hashCode()
static int
Return a hash code value consistent withequals(Object, Object)
.toString()
static boolean
uncheckedEquals
(Object a, Object b) Compares two cell values for equality without checking fornull
or type-system support.static int
Return a hash code value consistent withuncheckedEquals(Object, Object)
without checking fornull
or 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
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
-
equals
Compares two cell values for equality.Cell value equality follows conventional Java behavior, except for
BYTES
cells which are compared usingArrays.equals(byte[], byte[])
.- Parameters:
a
- first cell valueb
- second cell value- Returns:
true
if the cell values are equal
-
uncheckedEquals
Compares two cell values for equality without checking fornull
or 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:
true
if the cell values are equal
-
hashCode
Return a hash code value consistent withequals(Object, Object)
.- Parameters:
a
- the value of a supportedType
for which the hash code is determined- Returns:
- the hash code of
a
-
uncheckedHashCode
Return a hash code value consistent withuncheckedEquals(Object, Object)
without checking fornull
or 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()
-