Class SegmentPropertyState

  • All Implemented Interfaces:
    PropertyState

    public class SegmentPropertyState
    extends java.lang.Object
    implements PropertyState
    A property, which can read a value or list record from a segment. It currently doesn't cache data.

    Depending on the property type, this is a record of type "VALUE" or a record of type "LIST" (for arrays).

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int count()
      The number of values of this property.
      boolean equals​(java.lang.Object object)  
      @NotNull GCGeneration getGcGeneration()
      Get the underlying segment's gc generation.
      @NotNull java.lang.String getName()  
      RecordId getRecordId()
      Returns the identifier of this record.
      protected int getRecordNumber()  
      protected Segment getSegment()
      Returns the segment that contains this record.
      @NotNull Type<?> getType()
      Determine the type of this property
      <T> T getValue​(Type<T> type)
      Value of this property.
      <T> T getValue​(Type<T> type, int index)
      Value at the given index.
      int hashCode()  
      boolean isArray()
      Determine whether the value is an array of atoms
      long size()
      The size of the value of this property.
      long size​(int index)
      The size of the value at the given index.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getName

        @NotNull
        public @NotNull java.lang.String getName()
        Specified by:
        getName in interface PropertyState
        Returns:
        the name of this property state
      • getType

        @NotNull
        public @NotNull Type<?> getType()
        Description copied from interface: PropertyState
        Determine the type of this property
        Specified by:
        getType in interface PropertyState
        Returns:
        the type of this property
      • isArray

        public boolean isArray()
        Description copied from interface: PropertyState
        Determine whether the value is an array of atoms
        Specified by:
        isArray in interface PropertyState
        Returns:
        true if and only if the value is an array of atoms.
      • count

        public int count()
        Description copied from interface: PropertyState
        The number of values of this property. 1 for atoms.
        Specified by:
        count in interface PropertyState
        Returns:
        number of values
      • 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.
        Specified by:
        getValue in interface PropertyState
        Parameters:
        type - target type
        Returns:
        the value of this property
      • size

        public long size()
        Description copied from interface: PropertyState
        The size of the value of this property.
        Specified by:
        size in interface PropertyState
        Returns:
        size of the value of this property
      • 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.
        Specified by:
        getValue in interface PropertyState
        Parameters:
        type - target type
        Returns:
        the value of this property at the given index
      • size

        public long size​(int index)
        Description copied from interface: PropertyState
        The size of the value at the given index.
        Specified by:
        size in interface PropertyState
        Returns:
        size of the value at the given index.
      • equals

        public boolean equals​(java.lang.Object object)
      • hashCode

        public int hashCode()
      • toString

        public java.lang.String toString()
      • getSegment

        protected Segment getSegment()
        Returns the segment that contains this record.
        Returns:
        segment that contains this record
      • getRecordNumber

        protected int getRecordNumber()
      • getRecordId

        public RecordId getRecordId()
        Returns the identifier of this record.
        Returns:
        record identifier
      • getGcGeneration

        @NotNull
        public @NotNull GCGeneration getGcGeneration()
        Get the underlying segment's gc generation. Might cause the segment to get loaded if the generation info is missing
        Returns:
        the segment's gc generation