class KiePMMLDescrLhsFactory {

    protected void declareConstraintsXor(final List<KiePMMLFieldOperatorValue> xorConstraints) {
        if (xorConstraints.size() != 2) {
            throw new KiePMMLException("Expecting two fields for XOR constraints, retrieved " + xorConstraints.size());
        }
        final String[] keys = new String[xorConstraints.size()];
        final String[] values = new String[xorConstraints.size()];
        for (int i = 0; i < keys.length; i++) {
            keys[i] = xorConstraints.get(i).getName();
            values[i] = xorConstraints.get(i).getConstraintsAsString();
        }
        final CEDescrBuilder<CEDescrBuilder<RuleDescrBuilder, AndDescr>, AndDescr> andBuilder = builder.and();
        final CEDescrBuilder<CEDescrBuilder<CEDescrBuilder<CEDescrBuilder<RuleDescrBuilder, AndDescr>, AndDescr>, NotDescr>, AndDescr> notBuilder = andBuilder.not().and();
        commonDeclarePatternWithConstraint(notBuilder, keys[0], values[0]);
        commonDeclarePatternWithConstraint(notBuilder, keys[1], values[1]);
        final CEDescrBuilder<CEDescrBuilder<CEDescrBuilder<CEDescrBuilder<RuleDescrBuilder, AndDescr>, AndDescr>, ExistsDescr>, OrDescr> existsBuilder = andBuilder.exists().or();
        commonDeclarePatternWithConstraint(existsBuilder, keys[0], values[0]);
        commonDeclarePatternWithConstraint(existsBuilder.or(), keys[1], values[1]);
    }

    private  KiePMMLDescrLhsFactory(final CEDescrBuilder<RuleDescrBuilder, AndDescr> builder);

}