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 PropertyState convert​(PropertyState state, Type<?> type)  
      static @NotNull 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 PropertyState createProperty​(java.lang.String name, java.lang.Iterable<javax.jcr.Value> values, int type)  
      static @NotNull PropertyState createProperty​(java.lang.String name, java.lang.Object value, Type<?> type)
      Create a PropertyState.
      static @NotNull PropertyState createProperty​(java.lang.String name, java.lang.String value, int type)
      Create a PropertyState from a string.
      static @NotNull PropertyState createProperty​(java.lang.String name, javax.jcr.Value value)
      Create a PropertyState based on a Value.
      static <T> @NotNull 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

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

      • createProperty

        @NotNull
        public static @NotNull 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 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 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 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 PropertyState createProperty​(java.lang.String name,
                                                            java.lang.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​(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