Package org.apache.jackrabbit.oak.api
Class Type<T>
java.lang.Object
org.apache.jackrabbit.oak.api.Type<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
Comparable<Type<?>>
Instances of this class map Java types to
property types
.
Passing an instance of this class to PropertyState.getValue(Type)
determines
the return type of that method.-
Field Summary
FieldsModifier and TypeFieldDescriptionMapIterable<Blob>
to array ofPropertyType.BINARY
MapBlob
toPropertyType.BINARY
MapBoolean
toPropertyType.BOOLEAN
MapIterable<Boolean>
to array ofPropertyType.BOOLEAN
MapString
toPropertyType.DATE
MapIterable<String>
to array ofPropertyType.DATE
static final Type<BigDecimal>
MapBigDecimal
toPropertyType.DECIMAL
static final Type<Iterable<BigDecimal>>
MapIterable<BigDecimal>
to array ofPropertyType.DECIMAL
MapDouble
toPropertyType.DOUBLE
MapIterable<Double>
to array ofPropertyType.DOUBLE
MapLong
toPropertyType.LONG
MapIterable<Long>
to array ofPropertyType.LONG
MapString
toPropertyType.STRING
MapIterable<String>
to array ofPropertyType.NAME
MapString
toPropertyType.PATH
MapIterable<String>
to array ofPropertyType.PATH
MapString
toPropertyType.REFERENCE
MapIterable<String>
to array ofPropertyType.REFERENCE
MapString
toPropertyType.STRING
MapIterable<String>
to array ofPropertyType.STRING
The special "undefined" type, never encountered in normal valuesMulti-valued "undefined" type, never encountered in normal valuesMapString
toPropertyType.URI
MapIterable<String>
to array ofPropertyType.URI
MapString
toPropertyType.WEAKREFERENCE
MapIterable<String>
to array ofPropertyType.WEAKREFERENCE
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
static Type<?>
fromString
(String string) Returns theType
with the given string representation.static Type<?>
fromTag
(int tag, boolean array) CorrespondingType
for a given type tag and array flag.Type<?>
Determine the array type which has this type as base typeType<?>
Determine the base type of array typesint
hashCode()
boolean
isArray()
Determine whether this is an array typeint
tag()
Corresponding type tag as defined inPropertyType
.toString()
-
Field Details
-
STRING
MapString
toPropertyType.STRING
-
BINARY
MapBlob
toPropertyType.BINARY
-
LONG
MapLong
toPropertyType.LONG
-
DOUBLE
MapDouble
toPropertyType.DOUBLE
-
DATE
MapString
toPropertyType.DATE
-
BOOLEAN
MapBoolean
toPropertyType.BOOLEAN
-
NAME
MapString
toPropertyType.STRING
-
PATH
MapString
toPropertyType.PATH
-
REFERENCE
MapString
toPropertyType.REFERENCE
-
WEAKREFERENCE
MapString
toPropertyType.WEAKREFERENCE
-
URI
MapString
toPropertyType.URI
-
DECIMAL
MapBigDecimal
toPropertyType.DECIMAL
-
STRINGS
MapIterable<String>
to array ofPropertyType.STRING
-
BINARIES
MapIterable<Blob>
to array ofPropertyType.BINARY
-
LONGS
MapIterable<Long>
to array ofPropertyType.LONG
-
DOUBLES
MapIterable<Double>
to array ofPropertyType.DOUBLE
-
DATES
MapIterable<String>
to array ofPropertyType.DATE
-
BOOLEANS
MapIterable<Boolean>
to array ofPropertyType.BOOLEAN
-
NAMES
MapIterable<String>
to array ofPropertyType.NAME
-
PATHS
MapIterable<String>
to array ofPropertyType.PATH
-
REFERENCES
MapIterable<String>
to array ofPropertyType.REFERENCE
-
WEAKREFERENCES
MapIterable<String>
to array ofPropertyType.WEAKREFERENCE
-
URIS
MapIterable<String>
to array ofPropertyType.URI
-
DECIMALS
MapIterable<BigDecimal>
to array ofPropertyType.DECIMAL
-
UNDEFINED
The special "undefined" type, never encountered in normal values -
UNDEFINEDS
Multi-valued "undefined" type, never encountered in normal values
-
-
Method Details
-
tag
public int tag()Corresponding type tag as defined inPropertyType
.- Returns:
- type tag
-
isArray
public boolean isArray()Determine whether this is an array type- Returns:
true
if and only if this is an array type
-
fromTag
CorrespondingType
for a given type tag and array flag.- Parameters:
tag
- type tag as defined inPropertyType
.array
- whether this is an array or not- Returns:
Type
instance- Throws:
IllegalArgumentException
- if tag is not valid as per definition inPropertyType
.
-
fromString
Returns theType
with the given string representation.- Parameters:
string
- type string- Returns:
- matching type
-
getBaseType
Determine the base type of array types- Returns:
- base type
- Throws:
IllegalStateException
- ifisArray
is false.
-
getArrayType
Determine the array type which has this type as base type- Returns:
- array type with this type as base type
- Throws:
IllegalStateException
- ifisArray
is true.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<T>
-
toString
-
hashCode
public int hashCode() -
equals
-