ValidationFunction<T>
public abstract class UniqueValidation<T,U> extends java.lang.Object implements ValidationFunction<T>
Constructor | Description |
---|---|
UniqueValidation() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
check(ValidationContext ctx,
T t) |
Returns
true if the constraint is valid and false
if it's broken. |
abstract U |
getNextObject(ValidationContext ctx,
T t,
int n) |
Returns the n-th object that should be tested.
|
abstract int |
getNumObjects(ValidationContext ctx,
T t) |
Returns the total number of objects which should be tested.
|
public boolean check(ValidationContext ctx, T t)
ValidationFunction
true
if the constraint is valid and false
if it's broken.check
in interface ValidationFunction<T>
ctx
- the context in which the validation is performedt
- the object to checkfalse
if the constraint is brokenpublic abstract int getNumObjects(ValidationContext ctx, T t)
ctx
- t
- public abstract U getNextObject(ValidationContext ctx, T t, int n)
ctx
- t
- n
-