Class EmptyPropertyState

    • Constructor Detail

      • EmptyPropertyState

        protected EmptyPropertyState​(@NotNull
                                     @NotNull java.lang.String name)
        Create a new property state with the given name
        Parameters:
        name - The name of the property state.
    • Method Detail

      • emptyProperty

        public static PropertyState emptyProperty​(java.lang.String name,
                                                  Type<?> type)
        Create an empty PropertyState
        Parameters:
        name - The name of the property state
        type - The type of the property state
        Returns:
        The new property state
        Throws:
        java.lang.IllegalArgumentException - if @code type.isArray()} is false.
      • getName

        @NotNull
        public @NotNull java.lang.String getName()
        Returns:
        the name of this property state
      • isArray

        public boolean isArray()
        Description copied from interface: PropertyState
        Determine whether the value is an array of atoms
        Returns:
        true
      • getValue

        @NotNull
        public <T> T getValue​(Type<T> type)
        Description copied from interface: PropertyState
        Value of this property. The type of the return value is determined by the target type argument. If type.isArray() is true, this method returns an Iterable of the base type of type containing all values of this property. If the target type is not the same as the type of this property an attempt is made to convert the value to the target type. If the conversion fails an exception is thrown. The actual conversions which take place are those defined in the org.apache.jackrabbit.oak.plugins.value.Conversions class.
        Parameters:
        type - target type
        Returns:
        An empty list if type.isArray() is true.
        Throws:
        java.lang.IllegalStateException - type.isArray() is false.
      • getValue

        @NotNull
        public <T> T getValue​(Type<T> type,
                              int index)
        Description copied from interface: PropertyState
        Value at the given index. The type of the return value is determined by the target type argument. If the target type is not the same as the type of this property an attempt is made to convert the value to the target type. If the conversion fails an exception is thrown. The actual conversions which take place are those defined in the org.apache.jackrabbit.oak.plugins.value.Conversions class.
        Parameters:
        type - target type
        Returns:
        the value of this property at the given index
        Throws:
        java.lang.IndexOutOfBoundsException - always
      • size

        public long size()
        Description copied from interface: PropertyState
        The size of the value of this property.
        Returns:
        size of the value of this property
        Throws:
        java.lang.IllegalStateException - always
      • size

        public long size​(int index)
        Description copied from interface: PropertyState
        The size of the value at the given index.
        Returns:
        size of the value at the given index.
        Throws:
        java.lang.IndexOutOfBoundsException - always
      • count

        public int count()
        Description copied from interface: PropertyState
        The number of values of this property. 1 for atoms.
        Returns:
        0