public interface PropertyState
Two property states are considered equal if and only if their names and
values match. The Object.equals(Object)
method needs to
be implemented so that it complies with this definition. And while
property states are not meant for use as hash keys, the
Object.hashCode()
method should still be implemented according
to this equality contract.
Modifier and Type | Method and Description |
---|---|
int |
count()
The number of values of this property.
|
@NotNull java.lang.String |
getName() |
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 . |
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 . |
@NotNull @NotNull java.lang.String getName()
boolean isArray()
true
if and only if the value is an array of atoms.Type<?> getType()
@NotNull <T> T getValue(Type<T> type)
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.T
- type
- target typejava.lang.IllegalStateException
- if type.isArray() == false
and
this.isArray() == true
. In other words, when trying to convert
from an array to an atom.java.lang.IllegalArgumentException
- if type
refers to an unknown type.java.lang.NumberFormatException
- if conversion to a number failed.java.lang.UnsupportedOperationException
- if conversion to boolean failed.@NotNull <T> T getValue(Type<T> type, int index)
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.T
- type
- target typeindex
- index
java.lang.IndexOutOfBoundsException
- if index
is less than 0
or
greater or equals count()
.java.lang.IllegalArgumentException
- if type
refers to an unknown type or if
type.isArray()
is true.long size()
java.lang.IllegalStateException
- if the value is an arraylong size(int index)
index
.index
- index
.java.lang.IndexOutOfBoundsException
- if index
is less than 0
or
greater or equals count()
.int count()
1
for atoms.Copyright © 2010 - 2020 Adobe. All Rights Reserved