public class MultiBinaryPropertyState extends EmptyPropertyState
Constructor and Description |
---|
MultiBinaryPropertyState(java.lang.String name,
java.lang.Iterable<Blob> values) |
Modifier and Type | Method and Description |
---|---|
static PropertyState |
binaryPropertyFromArray(java.lang.String name,
java.lang.Iterable<byte[]> values)
Create a multi valued
PropertyState from a list of byte arrays. |
static PropertyState |
binaryPropertyFromBlob(java.lang.String name,
java.lang.Iterable<Blob> values)
Create a multi valued
PropertyState from a list of Blob . |
int |
count()
The number of values of this property.
|
Conversions.Converter |
getConverter(Blob value)
Create a converter for converting a value to other types.
|
Type<?> |
getType()
Determine the type of this property
|
<S> S |
getValue(Type<S> type)
Value of this property.
|
<S> S |
getValue(Type<S> type,
int index)
Value at the given
index . |
long |
size(int index)
The size of the value at the given
index . |
emptyProperty, getName, isArray, size
public MultiBinaryPropertyState(java.lang.String name, java.lang.Iterable<Blob> values)
public static PropertyState binaryPropertyFromBlob(java.lang.String name, java.lang.Iterable<Blob> values)
PropertyState
from a list of Blob
.name
- The name of the property statevalues
- The values of the property stateType.BINARIES
public static PropertyState binaryPropertyFromArray(java.lang.String name, java.lang.Iterable<byte[]> values)
PropertyState
from a list of byte arrays.name
- The name of the property statevalues
- The values of the property stateType.BINARIES
public Conversions.Converter getConverter(Blob value)
value
- The value to convertpublic Type<?> getType()
PropertyState
@NotNull public <S> S getValue(Type<S> type)
PropertyState
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.getValue
in interface PropertyState
getValue
in class EmptyPropertyState
type
- target typetype.isArray()
is true
.java.lang.IllegalStateException
- if type.isArray()
is false
.java.lang.IllegalArgumentException
- if type
is not one of the
values defined in Type
@NotNull public <S> S getValue(Type<S> type, int index)
PropertyState
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.getValue
in interface PropertyState
getValue
in class EmptyPropertyState
type
- target typeindex
java.lang.IllegalArgumentException
- if type
is not one of the
values defined in Type
or if type.isArray()
is true
java.lang.IndexOutOfBoundsException
- if index >= count()
.public final int count()
PropertyState
1
for atoms.count
in interface PropertyState
count
in class EmptyPropertyState
0
public long size(int index)
PropertyState
index
.size
in interface PropertyState
size
in class EmptyPropertyState
index
.Copyright © 2010 - 2020 Adobe. All Rights Reserved