Class PropertyStates


  • public final class PropertyStates
    extends java.lang.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​(java.lang.String name, java.lang.Iterable<javax.jcr.Value> values)
      Create a multi valued PropertyState based on a list of Value instances.
      static org.apache.jackrabbit.oak.api.PropertyState createProperty​(java.lang.String name, java.lang.Iterable<javax.jcr.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 a PropertyState.
      static @NotNull org.apache.jackrabbit.oak.api.PropertyState createProperty​(java.lang.String name, java.lang.String value, int type)
      Create a PropertyState from a string.
      static @NotNull org.apache.jackrabbit.oak.api.PropertyState createProperty​(java.lang.String name, javax.jcr.Value value)
      Create a PropertyState based on a Value.
      static <T> @NotNull org.apache.jackrabbit.oak.api.PropertyState createProperty​(java.lang.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createProperty

        @NotNull
        public static @NotNull org.apache.jackrabbit.oak.api.PropertyState createProperty​(java.lang.String name,
                                                                                          javax.jcr.Value value)
                                                                                   throws javax.jcr.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:
        javax.jcr.RepositoryException - forwarded from value
      • createProperty

        @NotNull
        public static @NotNull org.apache.jackrabbit.oak.api.PropertyState createProperty​(java.lang.String name,
                                                                                          java.lang.Iterable<javax.jcr.Value> values)
                                                                                   throws javax.jcr.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:
        javax.jcr.RepositoryException - forwarded from value
      • createProperty

        public static org.apache.jackrabbit.oak.api.PropertyState createProperty​(java.lang.String name,
                                                                                 java.lang.Iterable<javax.jcr.Value> values,
                                                                                 int type)
                                                                          throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • createProperty

        @NotNull
        public static @NotNull org.apache.jackrabbit.oak.api.PropertyState createProperty​(java.lang.String name,
                                                                                          java.lang.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​(java.lang.String name,
                                                                                          java.lang.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​(java.lang.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)