class ProxyConfigAuthValidator implements ConstraintValidator<ValidProxyConfigAuthRequest, ProxyRequest> {

    @Override
    public boolean isValid(ProxyRequest proxyRequest, ConstraintValidatorContext constraintValidatorContext) {
        String user = proxyRequest.getUserName();
        String password = proxyRequest.getPassword();
        return StringUtils.isAllEmpty(user, password) || StringUtils.isNoneBlank(user, password);
    }

}