Class PropertyStates


  • public final class PropertyStates
    extends java.lang.Object
    Utility class for creating PropertyState instances.
    • Method Detail

      • createProperty

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