class CheckClientSelectFieldsStateValidator implements ConstraintValidator<CheckClientSelect,
        ClientSelect>, ValidationErrorDescriptorBuilder {

    @Override
    public boolean isValid(ClientSelect value, ConstraintValidatorContext context) {
        List<ClientQueryField> fields = Optional.ofNullable(value.getFields()).orElse(new ArrayList<>());
        List<ClientQueryField> distinctFields = Optional.ofNullable(value.getDistinctFields()).orElse(new ArrayList<>());

        return !(fields.size() > 0 && distinctFields.size() > 0);

    }

}