Package io.dialob.api.form
Class ImmutableValidation
java.lang.Object
io.dialob.api.form.ImmutableValidation
- All Implemented Interfaces:
Validation,Serializable
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class ImmutableValidation
extends Object
implements Validation
Immutable implementation of
Validation.
Use the builder to create immutable instances:
ImmutableValidation.builder().
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableValidation. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableValidation.Builderbuilder()Creates a builder forImmutableValidation.static ImmutableValidationcopyOf(Validation instance) Creates an immutable copy of aValidationvalue.booleanThis instance is equal to all instances ofImmutableValidationthat have equal attribute values.getRule()inthashCode()Computes a hash code from attributes:message,rule.toString()Prints the immutable valueValidationwith attribute values.final ImmutableValidationwithMessage(Map<String, ? extends String> entries) Copy the current immutable object by replacing themessagemap with the specified map.final ImmutableValidationCopy the current immutable object by setting a value for theruleattribute.
-
Method Details
-
getMessage
- Specified by:
getMessagein interfaceValidation- Returns:
- The value of the
messageattribute
-
getRule
- Specified by:
getRulein interfaceValidation- Returns:
- The value of the
ruleattribute
-
withMessage
Copy the current immutable object by replacing themessagemap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the message map- Returns:
- A modified copy of
thisobject
-
withRule
Copy the current immutable object by setting a value for theruleattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for rule (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableValidationthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:message,rule. -
toString
Prints the immutable valueValidationwith attribute values. -
copyOf
Creates an immutable copy of aValidationvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Validation instance
-
builder
Creates a builder forImmutableValidation.ImmutableValidation.builder() .putMessage|putAllMessage(String => String) //messagemappings .rule(String | null) // nullablerule.build();- Returns:
- A new ImmutableValidation builder
-