Class MultiDecimalPropertyState
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.memory.AbstractPropertyState
-
- org.apache.jackrabbit.oak.plugins.memory.EmptyPropertyState
-
- org.apache.jackrabbit.oak.plugins.memory.MultiDecimalPropertyState
-
- All Implemented Interfaces:
org.apache.jackrabbit.oak.api.PropertyState
public class MultiDecimalPropertyState extends EmptyPropertyState
-
-
Constructor Summary
Constructors Constructor Description MultiDecimalPropertyState(String name, Iterable<BigDecimal> values)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcount()static org.apache.jackrabbit.oak.api.PropertyStatedecimalProperty(String name, Iterable<BigDecimal> values)Create a multi valuedPropertyStatefrom a list of decimals.Conversions.ConvertergetConverter(BigDecimal 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)longsize(int index)-
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
-
MultiDecimalPropertyState
public MultiDecimalPropertyState(String name, Iterable<BigDecimal> values)
-
-
Method Detail
-
decimalProperty
public static org.apache.jackrabbit.oak.api.PropertyState decimalProperty(String name, Iterable<BigDecimal> values)
Create a multi valuedPropertyStatefrom a list of decimals.- Parameters:
name- The name of the property statevalues- The values of the property state- Returns:
- The new property state of type
Type.DECIMALS
-
getConverter
public Conversions.Converter getConverter(BigDecimal 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
-
-