T
- public class ValidationConstraint<T> extends AbstractConstraint<T>
ValidationFunction
object to
perform validation.
Notice that two ValidationConstraint
objects are equal if they have the same error CodeModifier and Type | Field and Description |
---|---|
private ValidationFunction<T> |
func |
protected static org.apache.log4j.Logger |
logger |
Constructor and Description |
---|
ValidationConstraint(int errorCode,
ValidationFunction<T> func) |
Modifier and Type | Method and Description |
---|---|
boolean |
check(ValidationContext context,
T t)
Checks if the object conforms to the specific rule in the given context.
|
boolean |
equals(java.lang.Object obj)
Two
ValidationConstraint objects are euqal if they have the same
error code. |
getErrorCode
protected static transient org.apache.log4j.Logger logger
private ValidationFunction<T> func
public ValidationConstraint(int errorCode, ValidationFunction<T> func)
public boolean equals(java.lang.Object obj)
ValidationConstraint
objects are euqal if they have the same
error code.equals
in class java.lang.Object
public boolean check(ValidationContext context, T t)
AnyConstraint
If the rule behaves different for each level/version, the level and version of the context will be used.