Class ModifiableValidation

    • Method Detail

      • create

        public static ModifiableValidation create()
        Construct a modifiable instance of Validation.
        Returns:
        A new modifiable instance
      • getRule

        public final String getRule()
        Specified by:
        getRule in interface Validation
        Returns:
        value of rule attribute, may be null
      • clear

        public ModifiableValidation clear()
        Clears the object by setting all attributes to their initial values.
        Returns:
        this for use in a chained invocation
      • from

        public ModifiableValidation from​(Validation instance)
        Fill this modifiable instance with attribute values from the provided Validation instance. Regular attribute values will be overridden, i.e. replaced with ones of an instance. Any of the instance's absent optional values will not be copied (will not override current values). Collection elements and entries will be added, not replaced.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this for use in a chained invocation
      • from

        public ModifiableValidation from​(ModifiableValidation instance)
        Fill this modifiable instance with attribute values from the provided Validation instance. Regular attribute values will be overridden, i.e. replaced with ones of an instance. Any of the instance's absent optional values will not be copied (will not override current values). Collection elements and entries will be added, not replaced.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this for use in a chained invocation
      • putMessage

        public ModifiableValidation putMessage​(String key,
                                               String value)
        Put one entry to the message map.
        Parameters:
        key - The key in message map
        value - The associated value in the message map
        Returns:
        this for use in a chained invocation
      • setMessage

        public ModifiableValidation setMessage​(Map<String,​? extends String> entries)
        Sets or replaces all mappings from the specified map as entries for the message map. Nulls are not permitted as keys or values.
        Parameters:
        entries - The entries that will be added to the message map
        Returns:
        this for use in a chained invocation
      • putAllMessage

        public ModifiableValidation putAllMessage​(Map<String,​? extends String> entries)
        Put all mappings from the specified map as entries to the message map. Nulls are not permitted as keys or values.
        Parameters:
        entries - to be added to message map
        Returns:
        this for use in a chained invocation
      • setRule

        public ModifiableValidation setRule​(String rule)
        Assigns a value to the rule attribute.
        Parameters:
        rule - The value for rule, can be null
        Returns:
        this for use in a chained invocation
      • isInitialized

        public final boolean isInitialized()
        Returns true if all required attributes are set, indicating that the object is initialized.
        Returns:
        true if set
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ModifiableValidation that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: message, rule.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Generates a string representation of this Validation. If uninitialized, some attribute values may appear as question marks.
        Overrides:
        toString in class Object
        Returns:
        A string representation