Class PropertyStates
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.memory.PropertyStates
-
public final class PropertyStates extends java.lang.Object
Utility class for creatingPropertyState
instances.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PropertyState
convert(PropertyState state, Type<?> type)
static @NotNull PropertyState
createProperty(java.lang.String name, java.lang.Iterable<Value> values)
Create a multi valuedPropertyState
based on a list ofValue
instances.static PropertyState
createProperty(java.lang.String name, java.lang.Iterable<Value> values, int type)
static @NotNull PropertyState
createProperty(java.lang.String name, java.lang.Object value, Type<?> type)
Create aPropertyState
.static @NotNull PropertyState
createProperty(java.lang.String name, java.lang.String value, int type)
Create aPropertyState
from a string.static @NotNull PropertyState
createProperty(java.lang.String name, Value value)
Create aPropertyState
based on aValue
.static <T> @NotNull PropertyState
createProperty(java.lang.String name, T value)
Create aPropertyState
where theType
of the property state is inferred from the runtime type ofT
according to the mapping established throughType
.
-
-
-
Method Detail
-
createProperty
@NotNull public static @NotNull PropertyState createProperty(java.lang.String name, Value value) throws RepositoryException
Create aPropertyState
based on aValue
. TheType
of the property state is determined by the type of the value.- Parameters:
name
- The name of the property statevalue
- The value of the property state- Returns:
- The new property state
- Throws:
RepositoryException
- forwarded fromvalue
-
createProperty
@NotNull public static @NotNull PropertyState createProperty(java.lang.String name, java.lang.Iterable<Value> values) throws RepositoryException
Create a multi valuedPropertyState
based on a list ofValue
instances. TheType
of the property is determined by the type of the first value in the list orType.STRING
if the list is empty.- Parameters:
name
- The name of the property statevalues
- The values of the property state- Returns:
- The new property state
- Throws:
RepositoryException
- forwarded fromvalue
-
createProperty
public static PropertyState createProperty(java.lang.String name, java.lang.Iterable<Value> values, int type) throws RepositoryException
- Throws:
RepositoryException
-
createProperty
@NotNull public static @NotNull PropertyState createProperty(java.lang.String name, java.lang.String value, int type)
Create aPropertyState
from a string.- Parameters:
name
- The name of the property statevalue
- The value of the property statetype
- The type of the property state- Returns:
- The new property state
-
createProperty
@NotNull public static @NotNull PropertyState createProperty(java.lang.String name, java.lang.Object value, Type<?> type)
Create aPropertyState
.- Parameters:
name
- The name of the property statevalue
- The value of the property statetype
- The type of the property state- Returns:
- The new property state
-
createProperty
@NotNull public static <T> @NotNull PropertyState createProperty(java.lang.String name, T value)
Create aPropertyState
where theType
of the property state is inferred from the runtime type ofT
according to the mapping established throughType
.- Parameters:
name
- The name of the property statevalue
- The value of the property state- Returns:
- The new property state
-
convert
public static PropertyState convert(PropertyState state, Type<?> type)
-
-