public abstract class EmptyPropertyState extends AbstractPropertyState
PropertyState
implementations
providing default implementation which correspond to a property
without any value.Modifier and Type | Method and Description |
---|---|
int |
count()
The number of values of this property.
|
static PropertyState |
emptyProperty(java.lang.String name,
Type<?> type)
Create an empty
PropertyState |
@NotNull java.lang.String |
getName() |
<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 . |
equal, equals, hashCode, hashCode, toString, toString
getType
public static PropertyState emptyProperty(java.lang.String name, Type<?> type)
PropertyState
name
- The name of the property statetype
- The type of the property statejava.lang.IllegalArgumentException
- if @code type.isArray()} is false
.@NotNull public @NotNull java.lang.String getName()
public boolean isArray()
PropertyState
true
@NotNull public <T> T getValue(Type<T> 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.type
- target typetype.isArray()
is true
.java.lang.IllegalStateException
- type.isArray()
is false
.@NotNull public <T> T getValue(Type<T> 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.type
- target typeindex
java.lang.IndexOutOfBoundsException
- alwayspublic long size()
PropertyState
java.lang.IllegalStateException
- alwayspublic long size(int index)
PropertyState
index
.index
.java.lang.IndexOutOfBoundsException
- alwayspublic int count()
PropertyState
1
for atoms.0
Copyright © 2010 - 2023 Adobe. All Rights Reserved