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<?>>
public final class Type<T> extends Object implements Comparable<Type<?>>
Instances of this class map Java types toproperty types
. Passing an instance of this class toPropertyState.getValue(Type)
determines the return type of that method.
-
-
Field Summary
Fields Modifier and Type Field Description static Type<Iterable<Blob>>
BINARIES
MapIterable<Blob>
to array ofPropertyType.BINARY
static Type<Blob>
BINARY
MapBlob
toPropertyType.BINARY
static Type<Boolean>
BOOLEAN
MapBoolean
toPropertyType.BOOLEAN
static Type<Iterable<Boolean>>
BOOLEANS
MapIterable<Boolean>
to array ofPropertyType.BOOLEAN
static Type<String>
DATE
MapString
toPropertyType.DATE
static Type<Iterable<String>>
DATES
MapIterable<String>
to array ofPropertyType.DATE
static Type<BigDecimal>
DECIMAL
MapBigDecimal
toPropertyType.DECIMAL
static Type<Iterable<BigDecimal>>
DECIMALS
MapIterable<BigDecimal>
to array ofPropertyType.DECIMAL
static Type<Double>
DOUBLE
MapDouble
toPropertyType.DOUBLE
static Type<Iterable<Double>>
DOUBLES
MapIterable<Double>
to array ofPropertyType.DOUBLE
static Type<Long>
LONG
MapLong
toPropertyType.LONG
static Type<Iterable<Long>>
LONGS
MapIterable<Long>
to array ofPropertyType.LONG
static Type<String>
NAME
MapString
toPropertyType.STRING
static Type<Iterable<String>>
NAMES
MapIterable<String>
to array ofPropertyType.NAME
static Type<String>
PATH
MapString
toPropertyType.PATH
static Type<Iterable<String>>
PATHS
MapIterable<String>
to array ofPropertyType.PATH
static Type<String>
REFERENCE
MapString
toPropertyType.REFERENCE
static Type<Iterable<String>>
REFERENCES
MapIterable<String>
to array ofPropertyType.REFERENCE
static Type<String>
STRING
MapString
toPropertyType.STRING
static Type<Iterable<String>>
STRINGS
MapIterable<String>
to array ofPropertyType.STRING
static Type<Void>
UNDEFINED
The special "undefined" type, never encountered in normal valuesstatic Type<Iterable<Void>>
UNDEFINEDS
Multi-valued "undefined" type, never encountered in normal valuesstatic Type<String>
URI
MapString
toPropertyType.URI
static Type<Iterable<String>>
URIS
MapIterable<String>
to array ofPropertyType.URI
static Type<String>
WEAKREFERENCE
MapString
toPropertyType.WEAKREFERENCE
static Type<Iterable<String>>
WEAKREFERENCES
MapIterable<String>
to array ofPropertyType.WEAKREFERENCE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(@NotNull Type<?> that)
boolean
equals(Object other)
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<?>
getArrayType()
Determine the array type which has this type as base typeType<?>
getBaseType()
Determine the base type of array typesint
hashCode()
boolean
isArray()
Determine whether this is an array typeint
tag()
Corresponding type tag as defined inPropertyType
.String
toString()
-
-
-
Field Detail
-
STRING
public static final Type<String> STRING
MapString
toPropertyType.STRING
-
BINARY
public static final Type<Blob> BINARY
MapBlob
toPropertyType.BINARY
-
LONG
public static final Type<Long> LONG
MapLong
toPropertyType.LONG
-
DOUBLE
public static final Type<Double> DOUBLE
MapDouble
toPropertyType.DOUBLE
-
DATE
public static final Type<String> DATE
MapString
toPropertyType.DATE
-
BOOLEAN
public static final Type<Boolean> BOOLEAN
MapBoolean
toPropertyType.BOOLEAN
-
NAME
public static final Type<String> NAME
MapString
toPropertyType.STRING
-
PATH
public static final Type<String> PATH
MapString
toPropertyType.PATH
-
REFERENCE
public static final Type<String> REFERENCE
MapString
toPropertyType.REFERENCE
-
WEAKREFERENCE
public static final Type<String> WEAKREFERENCE
MapString
toPropertyType.WEAKREFERENCE
-
URI
public static final Type<String> URI
MapString
toPropertyType.URI
-
DECIMAL
public static final Type<BigDecimal> DECIMAL
MapBigDecimal
toPropertyType.DECIMAL
-
STRINGS
public static final Type<Iterable<String>> STRINGS
MapIterable<String>
to array ofPropertyType.STRING
-
BINARIES
public static final Type<Iterable<Blob>> BINARIES
MapIterable<Blob>
to array ofPropertyType.BINARY
-
LONGS
public static final Type<Iterable<Long>> LONGS
MapIterable<Long>
to array ofPropertyType.LONG
-
DOUBLES
public static final Type<Iterable<Double>> DOUBLES
MapIterable<Double>
to array ofPropertyType.DOUBLE
-
DATES
public static final Type<Iterable<String>> DATES
MapIterable<String>
to array ofPropertyType.DATE
-
BOOLEANS
public static final Type<Iterable<Boolean>> BOOLEANS
MapIterable<Boolean>
to array ofPropertyType.BOOLEAN
-
NAMES
public static final Type<Iterable<String>> NAMES
MapIterable<String>
to array ofPropertyType.NAME
-
PATHS
public static final Type<Iterable<String>> PATHS
MapIterable<String>
to array ofPropertyType.PATH
-
REFERENCES
public static final Type<Iterable<String>> REFERENCES
MapIterable<String>
to array ofPropertyType.REFERENCE
-
WEAKREFERENCES
public static final Type<Iterable<String>> WEAKREFERENCES
MapIterable<String>
to array ofPropertyType.WEAKREFERENCE
-
URIS
public static final Type<Iterable<String>> URIS
MapIterable<String>
to array ofPropertyType.URI
-
DECIMALS
public static final Type<Iterable<BigDecimal>> DECIMALS
MapIterable<BigDecimal>
to array ofPropertyType.DECIMAL
-
UNDEFINED
public static final Type<Void> UNDEFINED
The special "undefined" type, never encountered in normal values
-
-
Method Detail
-
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
public static Type<?> fromTag(int tag, boolean array)
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
public static Type<?> fromString(String string)
Returns theType
with the given string representation.- Parameters:
string
- type string- Returns:
- matching type
-
getBaseType
public Type<?> getBaseType()
Determine the base type of array types- Returns:
- base type
- Throws:
IllegalStateException
- ifisArray
is false.
-
getArrayType
public Type<?> 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
public int compareTo(@NotNull @NotNull Type<?> that)
- Specified by:
compareTo
in interfaceComparable<T>
-
-