Class PropertyStates


  • public final class PropertyStates
    extends Object
    Utility class for creating PropertyState 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​(String name, Iterable<Value> values)
      Create a multi valued PropertyState based on a list of Value instances.
      static org.apache.jackrabbit.oak.api.PropertyState createProperty​(String name, Iterable<Value> values, int type)  
      static @NotNull org.apache.jackrabbit.oak.api.PropertyState createProperty​(String name, Object value, org.apache.jackrabbit.oak.api.Type<?> type)
      Create a PropertyState.
      static @NotNull org.apache.jackrabbit.oak.api.PropertyState createProperty​(String name, String value, int type)
      Create a PropertyState from a string.
      static @NotNull org.apache.jackrabbit.oak.api.PropertyState createProperty​(String name, Value value)
      Create a PropertyState based on a Value.
      static <T> @NotNull org.apache.jackrabbit.oak.api.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.
    • Method Detail

      • createProperty

        @NotNull
        public static @NotNull org.apache.jackrabbit.oak.api.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 org.apache.jackrabbit.oak.api.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

        @NotNull
        public static @NotNull org.apache.jackrabbit.oak.api.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 org.apache.jackrabbit.oak.api.PropertyState createProperty​(String name,
                                                                                          Object value,
                                                                                          org.apache.jackrabbit.oak.api.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 org.apache.jackrabbit.oak.api.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 org.apache.jackrabbit.oak.api.PropertyState convert​(org.apache.jackrabbit.oak.api.PropertyState state,
                                                                          org.apache.jackrabbit.oak.api.Type<?> type)