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.BINARYMapBlobtoPropertyType.BINARYMapBooleantoPropertyType.BOOLEANMapIterable<Boolean>to array ofPropertyType.BOOLEANMapStringtoPropertyType.DATEMapIterable<String>to array ofPropertyType.DATEstatic final Type<BigDecimal>MapBigDecimaltoPropertyType.DECIMALstatic final Type<Iterable<BigDecimal>>MapIterable<BigDecimal>to array ofPropertyType.DECIMALMapDoubletoPropertyType.DOUBLEMapIterable<Double>to array ofPropertyType.DOUBLEMapLongtoPropertyType.LONGMapIterable<Long>to array ofPropertyType.LONGMapStringtoPropertyType.STRINGMapIterable<String>to array ofPropertyType.NAMEMapStringtoPropertyType.PATHMapIterable<String>to array ofPropertyType.PATHMapStringtoPropertyType.REFERENCEMapIterable<String>to array ofPropertyType.REFERENCEMapStringtoPropertyType.STRINGMapIterable<String>to array ofPropertyType.STRINGThe special "undefined" type, never encountered in normal valuesMulti-valued "undefined" type, never encountered in normal valuesMapStringtoPropertyType.URIMapIterable<String>to array ofPropertyType.URIMapStringtoPropertyType.WEAKREFERENCEMapIterable<String>to array ofPropertyType.WEAKREFERENCE -
Method Summary
Modifier and TypeMethodDescriptionintbooleanstatic 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<?>Determine the array type which has this type as base typeType<?>Determine the base type of array typesinthashCode()booleanisArray()Determine whether this is an array typeinttag()Corresponding type tag as defined inPropertyType.toString()
-
Field Details
-
STRING
MapStringtoPropertyType.STRING -
BINARY
MapBlobtoPropertyType.BINARY -
LONG
MapLongtoPropertyType.LONG -
DOUBLE
MapDoubletoPropertyType.DOUBLE -
DATE
MapStringtoPropertyType.DATE -
BOOLEAN
MapBooleantoPropertyType.BOOLEAN -
NAME
MapStringtoPropertyType.STRING -
PATH
MapStringtoPropertyType.PATH -
REFERENCE
MapStringtoPropertyType.REFERENCE -
WEAKREFERENCE
MapStringtoPropertyType.WEAKREFERENCE -
URI
MapStringtoPropertyType.URI -
DECIMAL
MapBigDecimaltoPropertyType.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:
trueif and only if this is an array type
-
fromTag
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
Returns theTypewith the given string representation.- Parameters:
string- type string- Returns:
- matching type
-
getBaseType
Determine the base type of array types- Returns:
- base type
- Throws:
IllegalStateException- ifisArrayis false.
-
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
- Specified by:
compareToin interfaceComparable<T>
-
toString
-
hashCode
public int hashCode() -
equals
-