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 theValidationtype.Use the
create()static factory methods to create new instances. Use thetoImmutable()method to convert to canonical immutable instances.ModifiableValidation is not thread-safe
- See Also:
ImmutableValidation, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ModifiableValidationclear()Clears the object by setting all attributes to their initial values.static ModifiableValidationcreate()Construct a modifiable instance ofValidation.booleanequals(Object another)This instance is equal to all instances ofModifiableValidationthat have equal attribute values.ModifiableValidationfrom(ModifiableValidation instance)Fill this modifiable instance with attribute values from the providedValidationinstance.ModifiableValidationfrom(Validation instance)Fill this modifiable instance with attribute values from the providedValidationinstance.Map<String,String>getMessage()StringgetRule()inthashCode()Computes a hash code from attributes:message,rule.booleanisInitialized()Returnstrueif all required attributes are set, indicating that the object is initialized.ModifiableValidationputAllMessage(Map<String,? extends String> entries)Put all mappings from the specified map as entries to themessagemap.ModifiableValidationputMessage(String key, String value)Put one entry to themessagemap.ModifiableValidationsetMessage(Map<String,? extends String> entries)Sets or replaces all mappings from the specified map as entries for themessagemap.ModifiableValidationsetRule(String rule)Assigns a value to theruleattribute.ImmutableValidationtoImmutable()Converts toImmutableValidation.StringtoString()Generates a string representation of thisValidation.
-
-
-
Method Detail
-
create
public static ModifiableValidation create()
Construct a modifiable instance ofValidation.- Returns:
- A new modifiable instance
-
getMessage
public final Map<String,String> getMessage()
- Specified by:
getMessagein interfaceValidation- Returns:
- value of
messageattribute
-
getRule
public final String getRule()
- Specified by:
getRulein interfaceValidation- Returns:
- value of
ruleattribute, may benull
-
clear
public ModifiableValidation clear()
Clears the object by setting all attributes to their initial values.- Returns:
thisfor use in a chained invocation
-
from
public ModifiableValidation from(Validation instance)
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
public ModifiableValidation from(ModifiableValidation instance)
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
public ModifiableValidation putMessage(String key, String value)
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
public ModifiableValidation setMessage(Map<String,? extends String> entries)
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
public ModifiableValidation putAllMessage(Map<String,? extends String> entries)
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
public ModifiableValidation setRule(String rule)
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
public final ImmutableValidation toImmutable()
Converts toImmutableValidation.- Returns:
- An immutable instance of Validation
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofModifiableValidationthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:message,rule.
-
-