Class PropertyStateValue
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.memory.PropertyStateValue
-
- All Implemented Interfaces:
java.lang.Comparable<PropertyValue>
,PropertyValue
public class PropertyStateValue extends java.lang.Object implements PropertyValue
APropertyValue
implementation that wraps aPropertyState
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(@NotNull PropertyValue p2)
int
count()
The number of values of this object.boolean
equals(java.lang.Object o)
@NotNull Type<?>
getType()
Determine the type of this value<T> T
getValue(Type<T> type)
Value of this object.<T> T
getValue(Type<T> type, int index)
Value at the givenindex
.int
hashCode()
boolean
isArray()
Determine whether the value is an array of atomslong
size()
The size of the value of this object.long
size(int index)
The size of the value at the givenindex
.java.lang.String
toString()
@Nullable PropertyState
unwrap()
-
-
-
Method Detail
-
isArray
public boolean isArray()
Description copied from interface:PropertyValue
Determine whether the value is an array of atoms- Specified by:
isArray
in interfacePropertyValue
- Returns:
true
if and only if the value is an array of atoms.
-
getType
@NotNull public @NotNull Type<?> getType()
Description copied from interface:PropertyValue
Determine the type of this value- Specified by:
getType
in interfacePropertyValue
- Returns:
- the type of this value
-
getValue
@NotNull public <T> T getValue(Type<T> type)
Description copied from interface:PropertyValue
Value of this object. The type of the return value is determined by the targettype
argument. Iftype.isArray()
is true, this method returns anIterable
of thebase type
oftype
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.- Specified by:
getValue
in interfacePropertyValue
- Parameters:
type
- target type- Returns:
- the value of this property
-
getValue
@NotNull public <T> T getValue(Type<T> type, int index)
Description copied from interface:PropertyValue
Value at the givenindex
. The type of the return value is determined by the targettype
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.- Specified by:
getValue
in interfacePropertyValue
- Parameters:
type
- target type- Returns:
- the value of this object at the given
index
-
size
public long size()
Description copied from interface:PropertyValue
The size of the value of this object.- Specified by:
size
in interfacePropertyValue
- Returns:
- size of the value of this property
-
size
public long size(int index)
Description copied from interface:PropertyValue
The size of the value at the givenindex
.- Specified by:
size
in interfacePropertyValue
- Returns:
- size of the value at the given
index
.
-
count
public int count()
Description copied from interface:PropertyValue
The number of values of this object.1
for atoms.- Specified by:
count
in interfacePropertyValue
- Returns:
- number of values
-
unwrap
@Nullable public @Nullable PropertyState unwrap()
-
compareTo
public int compareTo(@NotNull @NotNull PropertyValue p2)
- Specified by:
compareTo
in interfacejava.lang.Comparable<PropertyValue>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-