Class GenericPropertyState
java.lang.Object
org.apache.jackrabbit.oak.plugins.memory.AbstractPropertyState
org.apache.jackrabbit.oak.plugins.memory.EmptyPropertyState
org.apache.jackrabbit.oak.plugins.memory.GenericPropertyState
- All Implemented Interfaces:
org.apache.jackrabbit.oak.api.PropertyState
-
Constructor Summary
ConstructorsConstructorDescriptionGenericPropertyState(@NotNull String name, @NotNull String value, @NotNull org.apache.jackrabbit.oak.api.Type<?> type) -
Method Summary
Modifier and TypeMethodDescriptionintcount()static org.apache.jackrabbit.oak.api.PropertyStatedateProperty(String name, String value) Create aPropertyStatefrom a date.Create a converter for converting the value of this property to other types.org.apache.jackrabbit.oak.api.Type<?>getType()getValue()The value of this property<S> SgetValue(org.apache.jackrabbit.oak.api.Type<S> type) <S> SgetValue(org.apache.jackrabbit.oak.api.Type<S> type, int index) booleanisArray()static org.apache.jackrabbit.oak.api.PropertyStatenameProperty(String name, String value) Create aPropertyStatefrom a name.static org.apache.jackrabbit.oak.api.PropertyStatepathProperty(String name, String value) Create aPropertyStatefrom a path.static org.apache.jackrabbit.oak.api.PropertyStatereferenceProperty(String name, String value) Create aPropertyStatefrom a reference.longsize()longsize(int index) static org.apache.jackrabbit.oak.api.PropertyStateuriProperty(String name, String value) Create aPropertyStatefrom a URI.static org.apache.jackrabbit.oak.api.PropertyStateweakreferenceProperty(String name, String value) Create aPropertyStatefrom a weak reference.Methods inherited from class org.apache.jackrabbit.oak.plugins.memory.EmptyPropertyState
emptyProperty, getName
-
Constructor Details
-
GenericPropertyState
public GenericPropertyState(@NotNull @NotNull String name, @NotNull @NotNull String value, @NotNull @NotNull org.apache.jackrabbit.oak.api.Type<?> type) - Throws:
IllegalArgumentException- iftype.isArray()istrue
-
-
Method Details
-
dateProperty
Create aPropertyStatefrom a date. No validation is performed on the string passed forvalue.- Parameters:
name- The name of the property statevalue- The value of the property state- Returns:
- The new property state of type
Type.DATE
-
nameProperty
Create aPropertyStatefrom a name. No validation is performed on the string passed forvalue.- Parameters:
name- The name of the property statevalue- The value of the property state- Returns:
- The new property state of type
Type.NAME
-
pathProperty
Create aPropertyStatefrom a path. No validation is performed on the string passed forvalue.- Parameters:
name- The name of the property statevalue- The value of the property state- Returns:
- The new property state of type
Type.PATH
-
referenceProperty
public static org.apache.jackrabbit.oak.api.PropertyState referenceProperty(String name, String value) Create aPropertyStatefrom a reference. No validation is performed on the string passed forvalue.- Parameters:
name- The name of the property statevalue- The value of the property state- Returns:
- The new property state of type
Type.REFERENCE
-
weakreferenceProperty
public static org.apache.jackrabbit.oak.api.PropertyState weakreferenceProperty(String name, String value) Create aPropertyStatefrom a weak reference. No validation is performed on the string passed forvalue.- Parameters:
name- The name of the property statevalue- The value of the property state- Returns:
- The new property state of type
Type.WEAKREFERENCE
-
uriProperty
Create aPropertyStatefrom a URI. No validation is performed on the string passed forvalue.- Parameters:
name- The name of the property statevalue- The value of the property state- Returns:
- The new property state of type
Type.URI
-
getValue
The value of this property- Returns:
- Value of this property
-
getConverter
Create a converter for converting the value of this property to other types.- Returns:
- A converter for the value of this property
-
getType
public org.apache.jackrabbit.oak.api.Type<?> getType() -
isArray
public boolean isArray()- Specified by:
isArrayin interfaceorg.apache.jackrabbit.oak.api.PropertyState- Overrides:
isArrayin classEmptyPropertyState- Returns:
false
-
getValue
@NotNull public <S> S getValue(org.apache.jackrabbit.oak.api.Type<S> type) - Specified by:
getValuein interfaceorg.apache.jackrabbit.oak.api.PropertyState- Overrides:
getValuein classEmptyPropertyState- Returns:
- An empty list if
type.isArray()istrue. - Throws:
IllegalArgumentException- iftypeis not one of the values defined inType.
-
getValue
@NotNull public <S> S getValue(org.apache.jackrabbit.oak.api.Type<S> type, int index) - Specified by:
getValuein interfaceorg.apache.jackrabbit.oak.api.PropertyState- Overrides:
getValuein classEmptyPropertyState- Throws:
IllegalArgumentException- iftype.isArrayistrueIndexOutOfBoundsException- ifindex != 0
-
size
public long size()- Specified by:
sizein interfaceorg.apache.jackrabbit.oak.api.PropertyState- Overrides:
sizein classEmptyPropertyState- Returns:
getString().length()
-
size
public long size(int index) - Specified by:
sizein interfaceorg.apache.jackrabbit.oak.api.PropertyState- Overrides:
sizein classEmptyPropertyState- Returns:
size- Throws:
IndexOutOfBoundsException- ifindex != 0
-
count
public int count()- Specified by:
countin interfaceorg.apache.jackrabbit.oak.api.PropertyState- Overrides:
countin classEmptyPropertyState- Returns:
1
-