Class MultiGenericPropertyState
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.memory.AbstractPropertyState
-
- org.apache.jackrabbit.oak.plugins.memory.EmptyPropertyState
-
- org.apache.jackrabbit.oak.plugins.memory.MultiGenericPropertyState
-
- All Implemented Interfaces:
org.apache.jackrabbit.oak.api.PropertyState
public class MultiGenericPropertyState extends EmptyPropertyState
-
-
Constructor Summary
Constructors Constructor Description MultiGenericPropertyState(String name, Iterable<String> values, org.apache.jackrabbit.oak.api.Type<?> type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcount()static org.apache.jackrabbit.oak.api.PropertyStatedateProperty(String name, Iterable<String> values)Create a multi valuedPropertyStatefrom a list of dates.Conversions.ConvertergetConverter(String value)Create a converter for converting a value to other types.org.apache.jackrabbit.oak.api.Type<?>getType()<S> SgetValue(org.apache.jackrabbit.oak.api.Type<S> type)<S> SgetValue(org.apache.jackrabbit.oak.api.Type<S> type, int index)static org.apache.jackrabbit.oak.api.PropertyStatenameProperty(String name, Iterable<String> values)Create a multi valuedPropertyStatefrom a list of names.static org.apache.jackrabbit.oak.api.PropertyStatepathProperty(String name, Iterable<String> values)Create a multi valuedPropertyStatefrom a list of paths.static org.apache.jackrabbit.oak.api.PropertyStatereferenceProperty(String name, Iterable<String> values)Create a multi valuedPropertyStatefrom a list of references.longsize(int index)static org.apache.jackrabbit.oak.api.PropertyStateuriProperty(String name, Iterable<String> values)Create a multi valuedPropertyStatefrom a list of URIs.static org.apache.jackrabbit.oak.api.PropertyStateweakreferenceProperty(String name, Iterable<String> values)Create a multi valuedPropertyStatefrom a list of weak references.-
Methods inherited from class org.apache.jackrabbit.oak.plugins.memory.EmptyPropertyState
emptyProperty, getName, isArray, size
-
-
-
-
Field Detail
-
values
protected final List<T> values
-
-
Constructor Detail
-
MultiGenericPropertyState
public MultiGenericPropertyState(String name, Iterable<String> values, org.apache.jackrabbit.oak.api.Type<?> type)
- Throws:
IllegalArgumentException- iftype.isArray()isfalse
-
-
Method Detail
-
dateProperty
public static org.apache.jackrabbit.oak.api.PropertyState dateProperty(String name, Iterable<String> values)
Create a multi valuedPropertyStatefrom a list of dates.- Parameters:
name- The name of the property statevalues- The values of the property state- Returns:
- The new property state of type
Type.DATES
-
nameProperty
public static org.apache.jackrabbit.oak.api.PropertyState nameProperty(String name, Iterable<String> values)
Create a multi valuedPropertyStatefrom a list of names. No validation is performed on the strings passed forvalues.- Parameters:
name- The name of the property statevalues- The values of the property state- Returns:
- The new property state of type
Type.NAMES
-
pathProperty
public static org.apache.jackrabbit.oak.api.PropertyState pathProperty(String name, Iterable<String> values)
Create a multi valuedPropertyStatefrom a list of paths. No validation is performed on the strings passed forvalues.- Parameters:
name- The name of the property statevalues- The values of the property state- Returns:
- The new property state of type
Type.PATHS
-
referenceProperty
public static org.apache.jackrabbit.oak.api.PropertyState referenceProperty(String name, Iterable<String> values)
Create a multi valuedPropertyStatefrom a list of references. No validation is performed on the strings passed forvalues.- Parameters:
name- The name of the property statevalues- The values of the property state- Returns:
- The new property state of type
Type.REFERENCES
-
weakreferenceProperty
public static org.apache.jackrabbit.oak.api.PropertyState weakreferenceProperty(String name, Iterable<String> values)
Create a multi valuedPropertyStatefrom a list of weak references. No validation is performed on the strings passed forvalues.- Parameters:
name- The name of the property statevalues- The values of the property state- Returns:
- The new property state of type
Type.WEAKREFERENCES
-
uriProperty
public static org.apache.jackrabbit.oak.api.PropertyState uriProperty(String name, Iterable<String> values)
Create a multi valuedPropertyStatefrom a list of URIs. No validation is performed on the strings passed forvalues.- Parameters:
name- The name of the property statevalues- The values of the property state- Returns:
- The new property state of type
Type.URIS
-
getConverter
public Conversions.Converter getConverter(String value)
Create a converter for converting a value to other types.- Parameters:
value- The value to convert- Returns:
- A converter for the value of this property
-
getType
public org.apache.jackrabbit.oak.api.Type<?> getType()
-
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:
IllegalStateException- iftype.isArray()isfalse.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- iftypeis not one of the values defined inTypeor iftype.isArray()istrueIndexOutOfBoundsException- ifindex >= count().
-
count
public final int count()
- Specified by:
countin interfaceorg.apache.jackrabbit.oak.api.PropertyState- Overrides:
countin classEmptyPropertyState- Returns:
0
-
size
public long size(int index)
- Specified by:
sizein interfaceorg.apache.jackrabbit.oak.api.PropertyState- Overrides:
sizein classEmptyPropertyState
-
-