@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
@Constraint(validatedBy=UniqueListItemsValidator.class)
public @interface UniqueItems
Add this constraint to a List field or a List returning method. It checks that the constrained object does not
contain more than once the same item.
Note : for this constraint to work properly, items have to be comparable using equals() !
- Author:
- Gregory Fouquet