Class BinaryPropertyState

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

    public class BinaryPropertyState
    extends EmptyPropertyState
    • Constructor Detail

      • BinaryPropertyState

        public BinaryPropertyState​(@NotNull
                                   @NotNull 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 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 String name,
                                                                                 @NotNull
                                                                                 @NotNull 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 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 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:
        IllegalArgumentException - if type is not one of the values defined in Type.
      • count

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