org.dellroad.stuff.validation
Annotation Type Sorted


@Documented
@Constraint(validatedBy=SortedValidator.class)
@Target(value={METHOD,FIELD,ANNOTATION_TYPE})
@Retention(value=RUNTIME)
public @interface Sorted

Validation constraint that checks elements are sorted. Applies to non-primitive arrays, collections and maps; for maps, the keys are examined. If any element is null, it is skipped.


Optional Element Summary
 Class<? extends Comparator> comparator
          Specifies a Comparator to use.
 Class<?>[] groups
           
 String message
           
 Class<? extends Payload>[] payload
           
 boolean strict
          Configures whether the sorting should be strict, i.e., whether adjacent equal elements should be disallowed.
 

message

public abstract String message
Default:
"Collection is not sorted"

groups

public abstract Class<?>[] groups
Default:
{}

payload

public abstract Class<? extends Payload>[] payload
Default:
{}

comparator

public abstract Class<? extends Comparator> comparator
Specifies a Comparator to use. If none is specified, the natural sort ordering is used. The class must have a default constructor.

Default:
java.util.Comparator.class

strict

public abstract boolean strict
Configures whether the sorting should be strict, i.e., whether adjacent equal elements should be disallowed.

Default:
true