public class MultiGenericPropertyState extends EmptyPropertyState
| Constructor and Description |
|---|
MultiGenericPropertyState(java.lang.String name,
java.lang.Iterable<java.lang.String> values,
Type<?> type) |
| Modifier and Type | Method and Description |
|---|---|
int |
count()
The number of values of this property.
|
static PropertyState |
dateProperty(java.lang.String name,
java.lang.Iterable<java.lang.String> values)
Create a multi valued
PropertyState from a list of dates. |
Conversions.Converter |
getConverter(java.lang.String 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. |
static PropertyState |
nameProperty(java.lang.String name,
java.lang.Iterable<java.lang.String> values)
Create a multi valued
PropertyState from a list of names. |
static PropertyState |
pathProperty(java.lang.String name,
java.lang.Iterable<java.lang.String> values)
Create a multi valued
PropertyState from a list of paths. |
static PropertyState |
referenceProperty(java.lang.String name,
java.lang.Iterable<java.lang.String> values)
Create a multi valued
PropertyState from a list of references. |
long |
size(int index)
The size of the value at the given
index. |
static PropertyState |
uriProperty(java.lang.String name,
java.lang.Iterable<java.lang.String> values)
Create a multi valued
PropertyState from a list of URIs. |
static PropertyState |
weakreferenceProperty(java.lang.String name,
java.lang.Iterable<java.lang.String> values)
Create a multi valued
PropertyState from a list of weak references. |
emptyProperty, getName, isArray, sizepublic MultiGenericPropertyState(java.lang.String name,
java.lang.Iterable<java.lang.String> values,
Type<?> type)
java.lang.IllegalArgumentException - if type.isArray() is falsepublic static PropertyState dateProperty(java.lang.String name, java.lang.Iterable<java.lang.String> values)
PropertyState from a list of dates.name - The name of the property statevalues - The values of the property stateType.DATESpublic static PropertyState nameProperty(java.lang.String name, java.lang.Iterable<java.lang.String> values)
PropertyState from a list of names.
No validation is performed on the strings passed for values.name - The name of the property statevalues - The values of the property stateType.NAMESpublic static PropertyState pathProperty(java.lang.String name, java.lang.Iterable<java.lang.String> values)
PropertyState from a list of paths.
No validation is performed on the strings passed for values.name - The name of the property statevalues - The values of the property stateType.PATHSpublic static PropertyState referenceProperty(java.lang.String name, java.lang.Iterable<java.lang.String> values)
PropertyState from a list of references.
No validation is performed on the strings passed for values.name - The name of the property statevalues - The values of the property stateType.REFERENCESpublic static PropertyState weakreferenceProperty(java.lang.String name, java.lang.Iterable<java.lang.String> values)
PropertyState from a list of weak references.
No validation is performed on the strings passed for values.name - The name of the property statevalues - The values of the property stateType.WEAKREFERENCESpublic static PropertyState uriProperty(java.lang.String name, java.lang.Iterable<java.lang.String> values)
PropertyState from a list of URIs.
No validation is performed on the strings passed for values.name - The name of the property statevalues - The values of the property stateType.URISpublic Conversions.Converter getConverter(java.lang.String value)
value - The value to convertpublic Type<?> getType()
PropertyState@NotNull public <S> S getValue(Type<S> type)
PropertyStatetype
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 PropertyStategetValue in class EmptyPropertyStatetype - 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)
PropertyStateindex.
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 PropertyStategetValue in class EmptyPropertyStatetype - target typeindexjava.lang.IllegalArgumentException - if type is not one of the
values defined in Type or if type.isArray() is truejava.lang.IndexOutOfBoundsException - if index >= count().public final int count()
PropertyState1 for atoms.count in interface PropertyStatecount in class EmptyPropertyState0public long size(int index)
PropertyStateindex.size in interface PropertyStatesize in class EmptyPropertyStateindex.Copyright © 2010 - 2023 Adobe. All Rights Reserved