Class PropertyStates
java.lang.Object
org.apache.jackrabbit.oak.plugins.memory.PropertyStates
Utility class for creating
PropertyState instances.-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.jackrabbit.oak.api.PropertyStateconvert(org.apache.jackrabbit.oak.api.PropertyState state, org.apache.jackrabbit.oak.api.Type<?> type) static @NotNull org.apache.jackrabbit.oak.api.PropertyStatecreateProperty(String name, Iterable<Value> values) Create a multi valuedPropertyStatebased on a list ofValueinstances.static org.apache.jackrabbit.oak.api.PropertyStatecreateProperty(String name, Iterable<Value> values, int type) static @NotNull org.apache.jackrabbit.oak.api.PropertyStatecreateProperty(String name, Object value, org.apache.jackrabbit.oak.api.Type<?> type) Create aPropertyState.static @NotNull org.apache.jackrabbit.oak.api.PropertyStatecreateProperty(String name, String value, int type) Create aPropertyStatefrom a string.static @NotNull org.apache.jackrabbit.oak.api.PropertyStatecreateProperty(String name, Value value) Create aPropertyStatebased on aValue.static <T> @NotNull org.apache.jackrabbit.oak.api.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 org.apache.jackrabbit.oak.api.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 org.apache.jackrabbit.oak.api.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 org.apache.jackrabbit.oak.api.PropertyState createProperty(String name, Iterable<Value> values, int type) throws RepositoryException - Throws:
RepositoryException
-
createProperty
@NotNull public static @NotNull org.apache.jackrabbit.oak.api.PropertyState createProperty(String name, String value, int type) 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 org.apache.jackrabbit.oak.api.PropertyState createProperty(String name, 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(String name, T value) 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
public static org.apache.jackrabbit.oak.api.PropertyState convert(org.apache.jackrabbit.oak.api.PropertyState state, org.apache.jackrabbit.oak.api.Type<?> type)
-