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 org.apache.jackrabbit.oak.api.PropertyState
convert(org.apache.jackrabbit.oak.api.PropertyState state, org.apache.jackrabbit.oak.api.Type<?> type)
static @NotNull org.apache.jackrabbit.oak.api.PropertyState
createProperty(java.lang.String name, java.lang.Iterable<Value> values)
Create a multi valuedPropertyState
based on a list ofValue
instances.static org.apache.jackrabbit.oak.api.PropertyState
createProperty(java.lang.String name, java.lang.Iterable<Value> values, int type)
static @NotNull org.apache.jackrabbit.oak.api.PropertyState
createProperty(java.lang.String name, java.lang.Object value, org.apache.jackrabbit.oak.api.Type<?> type)
Create aPropertyState
.static @NotNull org.apache.jackrabbit.oak.api.PropertyState
createProperty(java.lang.String name, java.lang.String value, int type)
Create aPropertyState
from a string.static @NotNull org.apache.jackrabbit.oak.api.PropertyState
createProperty(java.lang.String name, Value value)
Create aPropertyState
based on aValue
.static <T> @NotNull org.apache.jackrabbit.oak.api.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 org.apache.jackrabbit.oak.api.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 org.apache.jackrabbit.oak.api.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 org.apache.jackrabbit.oak.api.PropertyState createProperty(java.lang.String name, java.lang.Iterable<Value> values, int type) throws RepositoryException
- Throws:
RepositoryException
-
createProperty
@NotNull public static @NotNull org.apache.jackrabbit.oak.api.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 org.apache.jackrabbit.oak.api.PropertyState createProperty(java.lang.String name, java.lang.Object value, org.apache.jackrabbit.oak.api.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 org.apache.jackrabbit.oak.api.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 org.apache.jackrabbit.oak.api.PropertyState convert(org.apache.jackrabbit.oak.api.PropertyState state, org.apache.jackrabbit.oak.api.Type<?> type)
-
-