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 for PropertyState implementations providing default implementation which correspond to a property without any value.
  • Constructor Details

    • EmptyPropertyState

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

    • emptyProperty

      public static org.apache.jackrabbit.oak.api.PropertyState emptyProperty(String name, org.apache.jackrabbit.oak.api.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:
      IllegalArgumentException - if @code type.isArray()} is false.
    • getName

      @NotNull public @NotNull 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() is true.
      Throws:
      IllegalStateException - type.isArray() is false.
    • getValue

      @NotNull public <T> T getValue(org.apache.jackrabbit.oak.api.Type<T> type, int index)
      Throws:
      IndexOutOfBoundsException - always
    • size

      public long size()
      Throws:
      IllegalStateException - always
    • size

      public long size(int index)
      Throws:
      IndexOutOfBoundsException - always
    • count

      public int count()
      Returns:
      0