Class BinaryPropertyState
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.memory.AbstractPropertyState
-
- org.apache.jackrabbit.oak.plugins.memory.EmptyPropertyState
-
- org.apache.jackrabbit.oak.plugins.memory.BinaryPropertyState
-
- All Implemented Interfaces:
org.apache.jackrabbit.oak.api.PropertyState
public class BinaryPropertyState extends EmptyPropertyState
-
-
Constructor Summary
Constructors Constructor Description BinaryPropertyState(@NotNull 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.PropertyStatebinaryProperty(@NotNull String name, @org.jetbrains.annotations.NotNull byte[] value)Create aPropertyStatefrom an array of bytes.static org.apache.jackrabbit.oak.api.PropertyStatebinaryProperty(@NotNull String name, @NotNull String value)Create aPropertyStatefrom an array of bytes.static org.apache.jackrabbit.oak.api.PropertyStatebinaryProperty(@NotNull String name, @NotNull Value value)Create aPropertyStatefrom aValue.static org.apache.jackrabbit.oak.api.PropertyStatebinaryProperty(@NotNull String name, @NotNull org.apache.jackrabbit.oak.api.Blob value)Create aPropertyStatefrom aBlob.intcount()Conversions.ConvertergetConverter()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.BlobgetValue()The value of this property<S> SgetValue(org.apache.jackrabbit.oak.api.Type<S> type)<S> SgetValue(org.apache.jackrabbit.oak.api.Type<S> type, int index)booleanisArray()longsize()longsize(int index)-
Methods inherited from class org.apache.jackrabbit.oak.plugins.memory.EmptyPropertyState
emptyProperty, getName
-
-
-
-
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 aPropertyStatefrom an array of bytes.- Parameters:
name- The name of the property statevalue- 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 aPropertyStatefrom an array of bytes.- Parameters:
name- The name of the property statevalue- 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 aPropertyStatefrom aBlob.- Parameters:
name- The name of the property statevalue- 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 RepositoryExceptionCreate aPropertyStatefrom aValue.- Parameters:
name- The name of the property statevalue- 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:
sizein interfaceorg.apache.jackrabbit.oak.api.PropertyState- Returns:
getString().length()
-
getType
public org.apache.jackrabbit.oak.api.Type<?> getType()
-
isArray
public boolean isArray()
- Specified by:
isArrayin interfaceorg.apache.jackrabbit.oak.api.PropertyState- Overrides:
isArrayin classEmptyPropertyState- Returns:
false
-
getValue
@NotNull public <S> S getValue(org.apache.jackrabbit.oak.api.Type<S> type)
- Specified by:
getValuein interfaceorg.apache.jackrabbit.oak.api.PropertyState- Overrides:
getValuein classEmptyPropertyState- Returns:
- An empty list if
type.isArray()istrue. - Throws:
IllegalArgumentException- iftypeis not one of the values defined inType.
-
getValue
@NotNull public <S> S getValue(org.apache.jackrabbit.oak.api.Type<S> type, int index)- Specified by:
getValuein interfaceorg.apache.jackrabbit.oak.api.PropertyState- Overrides:
getValuein classEmptyPropertyState- Throws:
IllegalArgumentException- iftype.isArrayistrueIndexOutOfBoundsException- ifindex != 0
-
size
public long size(int index)
- Specified by:
sizein interfaceorg.apache.jackrabbit.oak.api.PropertyState- Overrides:
sizein classEmptyPropertyState- Returns:
size- Throws:
IndexOutOfBoundsException- ifindex != 0
-
count
public int count()
- Specified by:
countin interfaceorg.apache.jackrabbit.oak.api.PropertyState- Overrides:
countin classEmptyPropertyState- Returns:
1
-
-