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
public abstract class EmptyPropertyState extends AbstractPropertyState
Abstract base class forPropertyStateimplementations providing default implementation which correspond to a property without any value.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedEmptyPropertyState(@NotNull java.lang.String name)Create a new property state with the givenname
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcount()static org.apache.jackrabbit.oak.api.PropertyStateemptyProperty(java.lang.String name, org.apache.jackrabbit.oak.api.Type<?> type)Create an emptyPropertyState@NotNull java.lang.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, toString
-
-
-
-
Method Detail
-
emptyProperty
public static org.apache.jackrabbit.oak.api.PropertyState emptyProperty(java.lang.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:
java.lang.IllegalArgumentException- if @code type.isArray()} isfalse.
-
getName
@NotNull public @NotNull java.lang.String 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:
java.lang.IllegalStateException-type.isArray()isfalse.
-
getValue
@NotNull public <T> T getValue(org.apache.jackrabbit.oak.api.Type<T> type, int index)- Throws:
java.lang.IndexOutOfBoundsException- always
-
size
public long size()
- Throws:
java.lang.IllegalStateException- always
-
size
public long size(int index)
- Throws:
java.lang.IndexOutOfBoundsException- always
-
count
public int count()
- Returns:
0
-
-