class HasSelectedPagesValidator implements ConstraintValidator<HasSelectedPages, ExtractPagesParameters> {

    @Override
    public boolean isValid(ExtractPagesParameters value, ConstraintValidatorContext context) {
        if (value != null) {
            return value.getPredefinedSetOfPages() != PredefinedSetOfPages.NONE || !value.getPageSelection().isEmpty();
        }
        return true;
    }

}