class CheckParametersExpressionContainerValidator implements ConstraintValidator<CheckParametersExpressionContainer, Map<String, ClientExpressionContainer>>, ValidationErrorDescriptorBuilder {

    @Override
    public boolean isValid(Map<String, ClientExpressionContainer> expressionMap, ConstraintValidatorContext context) {
        if (expressionMap == null) return true;

        for (Map.Entry<String, ClientExpressionContainer> entry : expressionMap.entrySet()) {
            ClientExpressionContainer expressionContainer = entry.getValue();

            if (expressionContainer == null) {
                return false;
            } else if (expressionContainer.getString() != null) {
                continue;
            }

            ClientExpression expression = expressionContainer.getObject();
            if (expression == null || !acceptedExpressions.contains(expression.getClass())){
                return false;
            }
        }

        return true;
    }

}