Class PropertyStates

java.lang.Object
org.apache.jackrabbit.oak.plugins.memory.PropertyStates

public final class PropertyStates extends Object
Utility class for creating PropertyState instances.
  • Method Details

    • createProperty

      @NotNull public static @NotNull PropertyState createProperty(String name, Value value) throws RepositoryException
      Create a PropertyState based on a Value. The Type of the property state is determined by the type of the value.
      Parameters:
      name - The name of the property state
      value - The value of the property state
      Returns:
      The new property state
      Throws:
      RepositoryException - forwarded from value
    • createProperty

      @NotNull public static @NotNull PropertyState createProperty(String name, Iterable<Value> values) throws RepositoryException
      Create a multi valued PropertyState based on a list of Value instances. The Type of the property is determined by the type of the first value in the list or Type.STRING if the list is empty.
      Parameters:
      name - The name of the property state
      values - The values of the property state
      Returns:
      The new property state
      Throws:
      RepositoryException - forwarded from value
    • createProperty

      public static PropertyState createProperty(String name, Iterable<Value> values, int type) throws RepositoryException
      Throws:
      RepositoryException
    • createProperty

      @NotNull public static @NotNull PropertyState createProperty(String name, String value, int type)
      Create a PropertyState from a string.
      Parameters:
      name - The name of the property state
      value - The value of the property state
      type - 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 a PropertyState.
      Parameters:
      name - The name of the property state
      value - The value of the property state
      type - The type of the property state
      Returns:
      The new property state
    • createProperty

      @NotNull public static <T> @NotNull PropertyState createProperty(String name, T value)
      Create a PropertyState where the Type of the property state is inferred from the runtime type of T according to the mapping established through Type.
      Parameters:
      name - The name of the property state
      value - The value of the property state
      Returns:
      The new property state
    • convert

      public static PropertyState convert(PropertyState state, Type<?> type)