Class BinaryPropertyState

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

    public class BinaryPropertyState
    extends EmptyPropertyState
    • Constructor Summary

      Constructors 
      Constructor Description
      BinaryPropertyState​(@NotNull java.lang.String name, @NotNull org.apache.jackrabbit.oak.api.Blob value)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.jackrabbit.oak.api.PropertyState binaryProperty​(@NotNull java.lang.String name, @org.jetbrains.annotations.NotNull byte[] value)
      Create a PropertyState from an array of bytes.
      static org.apache.jackrabbit.oak.api.PropertyState binaryProperty​(@NotNull java.lang.String name, @NotNull java.lang.String value)
      Create a PropertyState from an array of bytes.
      static org.apache.jackrabbit.oak.api.PropertyState binaryProperty​(@NotNull java.lang.String name, @NotNull Value value)
      Create a PropertyState from a Value.
      static org.apache.jackrabbit.oak.api.PropertyState binaryProperty​(@NotNull java.lang.String name, @NotNull org.apache.jackrabbit.oak.api.Blob value)
      Create a PropertyState from a Blob.
      int count()  
      Conversions.Converter getConverter()
      Create a converter for converting the value of this property to other types.
      org.apache.jackrabbit.oak.api.Type<?> getType()  
      org.apache.jackrabbit.oak.api.Blob getValue()
      The value of this property
      <S> S getValue​(org.apache.jackrabbit.oak.api.Type<S> type)  
      <S> S getValue​(org.apache.jackrabbit.oak.api.Type<S> type, int index)  
      boolean isArray()  
      long size()  
      long size​(int index)  
      • Methods inherited from class java.lang.Object

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

      • BinaryPropertyState

        public BinaryPropertyState​(@NotNull
                                   @NotNull java.lang.String name,
                                   @NotNull
                                   @NotNull org.apache.jackrabbit.oak.api.Blob value)
    • Method Detail

      • binaryProperty

        public static org.apache.jackrabbit.oak.api.PropertyState binaryProperty​(@NotNull
                                                                                 @NotNull java.lang.String name,
                                                                                 @NotNull
                                                                                 @org.jetbrains.annotations.NotNull byte[] value)
        Create a PropertyState from an array of bytes.
        Parameters:
        name - The name of the property state
        value - The value of the property state
        Returns:
        The new property state of type Type.BINARY
      • binaryProperty

        public static org.apache.jackrabbit.oak.api.PropertyState binaryProperty​(@NotNull
                                                                                 @NotNull java.lang.String name,
                                                                                 @NotNull
                                                                                 @NotNull java.lang.String value)
        Create a PropertyState from an array of bytes.
        Parameters:
        name - The name of the property state
        value - The value of the property state
        Returns:
        The new property state of type Type.BINARY
      • binaryProperty

        public static org.apache.jackrabbit.oak.api.PropertyState binaryProperty​(@NotNull
                                                                                 @NotNull java.lang.String name,
                                                                                 @NotNull
                                                                                 @NotNull org.apache.jackrabbit.oak.api.Blob value)
        Create a PropertyState from a Blob.
        Parameters:
        name - The name of the property state
        value - The value of the property state
        Returns:
        The new property state of type Type.BINARY
      • binaryProperty

        public static org.apache.jackrabbit.oak.api.PropertyState binaryProperty​(@NotNull
                                                                                 @NotNull java.lang.String name,
                                                                                 @NotNull
                                                                                 @NotNull Value value)
                                                                          throws RepositoryException
        Create a PropertyState from a Value.
        Parameters:
        name - The name of the property state
        value - The value of the property state
        Returns:
        The new property state of type Type.BINARY
        Throws:
        RepositoryException
      • getValue

        public org.apache.jackrabbit.oak.api.Blob getValue()
        The value of this property
        Returns:
        Value of this property
      • getConverter

        public Conversions.Converter getConverter()
        Create a converter for converting the value of this property to other types.
        Returns:
        A converter for the value of this property
      • size

        public long size()
        Specified by:
        size in interface org.apache.jackrabbit.oak.api.PropertyState
        Returns:
        getString().length()
      • getType

        public org.apache.jackrabbit.oak.api.Type<?> getType()
      • isArray

        public boolean isArray()
        Specified by:
        isArray in interface org.apache.jackrabbit.oak.api.PropertyState
        Overrides:
        isArray in class EmptyPropertyState
        Returns:
        false
      • 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.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.isArray is true
        java.lang.IndexOutOfBoundsException - if index != 0
      • size

        public long size​(int index)
        Specified by:
        size in interface org.apache.jackrabbit.oak.api.PropertyState
        Overrides:
        size in class EmptyPropertyState
        Returns:
        size
        Throws:
        java.lang.IndexOutOfBoundsException - if index != 0
      • count

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