Package io.dialob.api.form
Class ModifiableValidation
java.lang.Object
io.dialob.api.form.ModifiableValidation
- All Implemented Interfaces:
Validation,Serializable
@ParametersAreNonnullByDefault
@Generated({"Modifiables.generator","Validation"})
@NotThreadSafe
public final class ModifiableValidation
extends Object
implements Validation
A modifiable implementation of the
Validation type.
Use the create() static factory methods to create new instances.
Use the toImmutable() method to convert to canonical immutable instances.
ModifiableValidation is not thread-safe
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionclear()Clears the object by setting all attributes to their initial values.static ModifiableValidationcreate()Construct a modifiable instance ofValidation.booleanThis instance is equal to all instances ofModifiableValidationthat have equal attribute values.from(ModifiableValidation instance) Fill this modifiable instance with attribute values from the providedValidationinstance.from(Validation instance) Fill this modifiable instance with attribute values from the providedValidationinstance.final StringgetRule()inthashCode()Computes a hash code from attributes:message,rule.final booleanReturnstrueif all required attributes are set, indicating that the object is initialized.putAllMessage(Map<String, ? extends String> entries) Put all mappings from the specified map as entries to themessagemap.putMessage(String key, String value) Put one entry to themessagemap.setMessage(Map<String, ? extends String> entries) Sets or replaces all mappings from the specified map as entries for themessagemap.Assigns a value to theruleattribute.final ImmutableValidationConverts toImmutableValidation.toString()Generates a string representation of thisValidation.
-
Method Details
-
create
Construct a modifiable instance ofValidation.- Returns:
- A new modifiable instance
-
getMessage
- Specified by:
getMessagein interfaceValidation- Returns:
- value of
messageattribute
-
getRule
- Specified by:
getRulein interfaceValidation- Returns:
- value of
ruleattribute, may benull
-
clear
Clears the object by setting all attributes to their initial values.- Returns:
thisfor use in a chained invocation
-
from
Fill this modifiable instance with attribute values from the providedValidationinstance. 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:
thisfor use in a chained invocation
-
from
Fill this modifiable instance with attribute values from the providedValidationinstance. 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:
thisfor use in a chained invocation
-
putMessage
Put one entry to themessagemap.- Parameters:
key- The key in message mapvalue- The associated value in the message map- Returns:
thisfor use in a chained invocation
-
setMessage
Sets or replaces all mappings from the specified map as entries for themessagemap. Nulls are not permitted as keys or values.- Parameters:
entries- The entries that will be added to the message map- Returns:
thisfor use in a chained invocation
-
putAllMessage
Put all mappings from the specified map as entries to themessagemap. Nulls are not permitted as keys or values.- Parameters:
entries- to be added to message map- Returns:
thisfor use in a chained invocation
-
setRule
Assigns a value to theruleattribute.- Parameters:
rule- The value for rule, can benull- Returns:
thisfor use in a chained invocation
-
isInitialized
public final boolean isInitialized()Returnstrueif all required attributes are set, indicating that the object is initialized.- Returns:
trueif set
-
toImmutable
Converts toImmutableValidation.- Returns:
- An immutable instance of Validation
-
equals
This instance is equal to all instances ofModifiableValidationthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:message,rule. -
toString
Generates a string representation of thisValidation. If uninitialized, some attribute values may appear as question marks.
-