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>>BINARIESMapIterable<Blob>to array ofPropertyType.BINARYstatic Type<Blob>BINARYMapBlobtoPropertyType.BINARYstatic Type<Boolean>BOOLEANMapBooleantoPropertyType.BOOLEANstatic Type<Iterable<Boolean>>BOOLEANSMapIterable<Boolean>to array ofPropertyType.BOOLEANstatic Type<String>DATEMapStringtoPropertyType.DATEstatic Type<Iterable<String>>DATESMapIterable<String>to array ofPropertyType.DATEstatic Type<BigDecimal>DECIMALMapBigDecimaltoPropertyType.DECIMALstatic Type<Iterable<BigDecimal>>DECIMALSMapIterable<BigDecimal>to array ofPropertyType.DECIMALstatic Type<Double>DOUBLEMapDoubletoPropertyType.DOUBLEstatic Type<Iterable<Double>>DOUBLESMapIterable<Double>to array ofPropertyType.DOUBLEstatic Type<Long>LONGMapLongtoPropertyType.LONGstatic Type<Iterable<Long>>LONGSMapIterable<Long>to array ofPropertyType.LONGstatic Type<String>NAMEMapStringtoPropertyType.STRINGstatic Type<Iterable<String>>NAMESMapIterable<String>to array ofPropertyType.NAMEstatic Type<String>PATHMapStringtoPropertyType.PATHstatic Type<Iterable<String>>PATHSMapIterable<String>to array ofPropertyType.PATHstatic Type<String>REFERENCEMapStringtoPropertyType.REFERENCEstatic Type<Iterable<String>>REFERENCESMapIterable<String>to array ofPropertyType.REFERENCEstatic Type<String>STRINGMapStringtoPropertyType.STRINGstatic Type<Iterable<String>>STRINGSMapIterable<String>to array ofPropertyType.STRINGstatic Type<Void>UNDEFINEDThe special "undefined" type, never encountered in normal valuesstatic Type<Iterable<Void>>UNDEFINEDSMulti-valued "undefined" type, never encountered in normal valuesstatic Type<String>URIMapStringtoPropertyType.URIstatic Type<Iterable<String>>URISMapIterable<String>to array ofPropertyType.URIstatic Type<String>WEAKREFERENCEMapStringtoPropertyType.WEAKREFERENCEstatic Type<Iterable<String>>WEAKREFERENCESMapIterable<String>to array ofPropertyType.WEAKREFERENCE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(@NotNull Type<?> that)booleanequals(Object other)static Type<?>fromString(String string)Returns theTypewith the given string representation.static Type<?>fromTag(int tag, boolean array)CorrespondingTypefor 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 typesinthashCode()booleanisArray()Determine whether this is an array typeinttag()Corresponding type tag as defined inPropertyType.StringtoString()
-
-
-
Field Detail
-
STRING
public static final Type<String> STRING
MapStringtoPropertyType.STRING
-
BINARY
public static final Type<Blob> BINARY
MapBlobtoPropertyType.BINARY
-
LONG
public static final Type<Long> LONG
MapLongtoPropertyType.LONG
-
DOUBLE
public static final Type<Double> DOUBLE
MapDoubletoPropertyType.DOUBLE
-
DATE
public static final Type<String> DATE
MapStringtoPropertyType.DATE
-
BOOLEAN
public static final Type<Boolean> BOOLEAN
MapBooleantoPropertyType.BOOLEAN
-
NAME
public static final Type<String> NAME
MapStringtoPropertyType.STRING
-
PATH
public static final Type<String> PATH
MapStringtoPropertyType.PATH
-
REFERENCE
public static final Type<String> REFERENCE
MapStringtoPropertyType.REFERENCE
-
WEAKREFERENCE
public static final Type<String> WEAKREFERENCE
MapStringtoPropertyType.WEAKREFERENCE
-
URI
public static final Type<String> URI
MapStringtoPropertyType.URI
-
DECIMAL
public static final Type<BigDecimal> DECIMAL
MapBigDecimaltoPropertyType.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:
trueif and only if this is an array type
-
fromTag
public static Type<?> fromTag(int tag, boolean array)
CorrespondingTypefor a given type tag and array flag.- Parameters:
tag- type tag as defined inPropertyType.array- whether this is an array or not- Returns:
Typeinstance- Throws:
IllegalArgumentException- if tag is not valid as per definition inPropertyType.
-
fromString
public static Type<?> fromString(String string)
Returns theTypewith 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- ifisArrayis 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- ifisArrayis true.
-
compareTo
public int compareTo(@NotNull @NotNull Type<?> that)- Specified by:
compareToin interfaceComparable<T>
-
-