class CheckInMemoryDataSourceTypeValidator implements ConstraintValidator<CheckInMemoryDataSourceType, ClientReferenceable>,
        ValidationErrorDescriptorBuilder {

    @Override
    public ErrorDescriptor build(ConstraintViolation violation) {
        String dataSourceName = getClientResourceName(violation.getInvalidValue().getClass());
        return QUERY_IN_MEMORY_DATASOURCE_TYPE_NOT_SUPPORTED.createDescriptor(violation.getPropertyPath().toString(),
                dataSourceName);
    }

}