Class PropertyStates
java.lang.Object
org.apache.jackrabbit.oak.plugins.memory.PropertyStates
Utility class for creating
PropertyState instances.-
Method Summary
Modifier and TypeMethodDescriptionstatic PropertyStateconvert(PropertyState state, Type<?> type) static @NotNull PropertyStatecreateProperty(String name, Iterable<Value> values) Create a multi valuedPropertyStatebased on a list ofValueinstances.static PropertyStatecreateProperty(String name, Iterable<Value> values, int type) static @NotNull PropertyStatecreateProperty(String name, Object value, Type<?> type) Create aPropertyState.static @NotNull PropertyStatecreateProperty(String name, String value, int type) Create aPropertyStatefrom a string.static @NotNull PropertyStatecreateProperty(String name, Value value) Create aPropertyStatebased on aValue.static <T> @NotNull PropertyStatecreateProperty(String name, T value) Create aPropertyStatewhere theTypeof the property state is inferred from the runtime type ofTaccording to the mapping established throughType.
-
Method Details
-
createProperty
@NotNull public static @NotNull PropertyState createProperty(String name, Value value) throws RepositoryException Create aPropertyStatebased on aValue. TheTypeof 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(String name, Iterable<Value> values) throws RepositoryException Create a multi valuedPropertyStatebased on a list ofValueinstances. TheTypeof the property is determined by the type of the first value in the list orType.STRINGif 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(String name, Iterable<Value> values, int type) throws RepositoryException - Throws:
RepositoryException
-
createProperty
Create aPropertyStatefrom 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(String name, 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
Create aPropertyStatewhere theTypeof the property state is inferred from the runtime type ofTaccording 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
-