Class MultiDecimalPropertyState

  • All Implemented Interfaces:
    org.apache.jackrabbit.oak.api.PropertyState

    public class MultiDecimalPropertyState
    extends EmptyPropertyState
    • Field Detail

      • values

        protected final java.util.List<T> values
    • Constructor Detail

      • MultiDecimalPropertyState

        public MultiDecimalPropertyState​(java.lang.String name,
                                         java.lang.Iterable<java.math.BigDecimal> values)
    • Method Detail

      • decimalProperty

        public static org.apache.jackrabbit.oak.api.PropertyState decimalProperty​(java.lang.String name,
                                                                                  java.lang.Iterable<java.math.BigDecimal> values)
        Create a multi valued PropertyState from a list of decimals.
        Parameters:
        name - The name of the property state
        values - The values of the property state
        Returns:
        The new property state of type Type.DECIMALS
      • getConverter

        public Conversions.Converter getConverter​(java.math.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:
        getValue in interface org.apache.jackrabbit.oak.api.PropertyState
        Overrides:
        getValue in class EmptyPropertyState
        Returns:
        An empty list if type.isArray() is true.
        Throws:
        java.lang.IllegalStateException - if type.isArray() is false.
        java.lang.IllegalArgumentException - if type is not one of the values defined in Type
      • getValue

        @NotNull
        public <S> S getValue​(org.apache.jackrabbit.oak.api.Type<S> type,
                              int index)
        Specified by:
        getValue in interface org.apache.jackrabbit.oak.api.PropertyState
        Overrides:
        getValue in class EmptyPropertyState
        Throws:
        java.lang.IllegalArgumentException - if type is not one of the values defined in Type or if type.isArray() is true
        java.lang.IndexOutOfBoundsException - if index >= count().
      • count

        public final int count()
        Specified by:
        count in interface org.apache.jackrabbit.oak.api.PropertyState
        Overrides:
        count in class EmptyPropertyState
        Returns:
        0
      • size

        public long size​(int index)
        Specified by:
        size in interface org.apache.jackrabbit.oak.api.PropertyState
        Overrides:
        size in class EmptyPropertyState