Class EmptyPropertyState
java.lang.Object
org.apache.jackrabbit.oak.plugins.memory.AbstractPropertyState
org.apache.jackrabbit.oak.plugins.memory.EmptyPropertyState
- All Implemented Interfaces:
org.apache.jackrabbit.oak.api.PropertyState
- Direct Known Subclasses:
BinaryPropertyState,BooleanPropertyState,DecimalPropertyState,DoublePropertyState,GenericPropertyState,LongPropertyState,MultiBinaryPropertyState,MultiBooleanPropertyState,MultiDecimalPropertyState,MultiDoublePropertyState,MultiGenericPropertyState,MultiLongPropertyState,MultiStringPropertyState,StringPropertyState
Abstract base class for
PropertyState implementations
providing default implementation which correspond to a property
without any value.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEmptyPropertyState(@NotNull String name) Create a new property state with the givenname -
Method Summary
Modifier and TypeMethodDescriptionintcount()static org.apache.jackrabbit.oak.api.PropertyStateemptyProperty(String name, org.apache.jackrabbit.oak.api.Type<?> type) Create an emptyPropertyState@NotNull StringgetName()<T> TgetValue(org.apache.jackrabbit.oak.api.Type<T> type) <T> TgetValue(org.apache.jackrabbit.oak.api.Type<T> type, int index) booleanisArray()longsize()longsize(int index) Methods inherited from class org.apache.jackrabbit.oak.plugins.memory.AbstractPropertyState
equal, equals, hashCode, hashCode, toString, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.jackrabbit.oak.api.PropertyState
getType
-
Constructor Details
-
EmptyPropertyState
Create a new property state with the givenname- Parameters:
name- The name of the property state.
-
-
Method Details
-
emptyProperty
public static org.apache.jackrabbit.oak.api.PropertyState emptyProperty(String name, org.apache.jackrabbit.oak.api.Type<?> type) Create an emptyPropertyState- Parameters:
name- The name of the property statetype- The type of the property state- Returns:
- The new property state
- Throws:
IllegalArgumentException- if @code type.isArray()} isfalse.
-
getName
-
isArray
public boolean isArray()- Returns:
true
-
getValue
@NotNull public <T> T getValue(org.apache.jackrabbit.oak.api.Type<T> type) - Returns:
- An empty list if
type.isArray()istrue. - Throws:
IllegalStateException-type.isArray()isfalse.
-
getValue
@NotNull public <T> T getValue(org.apache.jackrabbit.oak.api.Type<T> type, int index) - Throws:
IndexOutOfBoundsException- always
-
size
public long size()- Throws:
IllegalStateException- always
-
size
public long size(int index) - Throws:
IndexOutOfBoundsException- always
-
count
public int count()- Returns:
0
-