@Test public void testMixedPredUsingOr() { CompoundPredicate predicate = new CompoundPredicate(); predicate.setBooleanOperator("or"); setupSimplePredicate(0,"TF1",SimpleSegmentPredicate.GREATER,"100"); Array valueSet = getNewArray("int", new BigInteger("4"), 1, 8, 16, 21); setupSimpleSetPredicate(0,"TF2","isNotIn",valueSet); predicate.getSimplePredicatesAndCompoundPredicatesAndSimpleSetPredicates().add(simplePredicate[0]); predicate.getSimplePredicatesAndCompoundPredicatesAndSimpleSetPredicates().add(simpleSetPredicate[0]); CompoundSegmentPredicate testPredicate = new CompoundSegmentPredicate(predicate); String text = testPredicate.getPredicateRule(); assertNotNull(text); assertEquals(text,"((( mTF1 == false ) && ( vTF1 > 100 )) || (( mTF2 == false ) && ( vTF2 not in ( 1, 8, 16, 21 ) )))"); }
@Override public String getPredicateRule() { if (booleanOperator.equalsIgnoreCase("and")) { return buildAndPredicate(); } else if (booleanOperator.equalsIgnoreCase("or")) { return buildOrPredicate(); } else if (booleanOperator.equalsIgnoreCase("xor")) { return buildXorPredicate(); } else if (hasSurrogation()) { return buildSurrogationPredicate(); } return null; }
CompoundSegmentPredicate implements PredicateRuleProducer { @Override public String getPredicateRule() { if (booleanOperator.equalsIgnoreCase("and")) { return buildAndPredicate(); } else if (booleanOperator.equalsIgnoreCase("or")) { return buildOrPredicate(); } else if (booleanOperator.equalsIgnoreCase("xor")) { return buildXorPredicate(); } else if (hasSurrogation()) { return buildSurrogationPredicate(); } return null; } }
CompoundSegmentPredicate implements PredicateRuleProducer { @Override public String getPredicateRule() { if (booleanOperator.equalsIgnoreCase("and")) { return buildAndPredicate(); } else if (booleanOperator.equalsIgnoreCase("or")) { return buildOrPredicate(); } else if (booleanOperator.equalsIgnoreCase("xor")) { return buildXorPredicate(); } else if (hasSurrogation()) { return buildSurrogationPredicate(); } return null; } CompoundSegmentPredicate();  CompoundSegmentPredicate(CompoundPredicate predicate); }
CompoundSegmentPredicate implements PredicateRuleProducer { @Override public String getPredicateRule() { if (booleanOperator.equalsIgnoreCase("and")) { return buildAndPredicate(); } else if (booleanOperator.equalsIgnoreCase("or")) { return buildOrPredicate(); } else if (booleanOperator.equalsIgnoreCase("xor")) { return buildXorPredicate(); } else if (hasSurrogation()) { return buildSurrogationPredicate(); } return null; } CompoundSegmentPredicate();  CompoundSegmentPredicate(CompoundPredicate predicate); List<String> getPredicateFieldNames(); List<String> getFieldMissingFieldNames(); String getPrimaryPredicateRule(); String getNextPredicateRule(int lastPredicate); int getSubpredicateCount(); boolean hasSurrogation(); @Override String getPredicateRule(); @Override boolean isAlwaysTrue(); @Override boolean isAlwaysFalse(); }
CompoundSegmentPredicate implements PredicateRuleProducer { @Override public String getPredicateRule() { if (booleanOperator.equalsIgnoreCase("and")) { return buildAndPredicate(); } else if (booleanOperator.equalsIgnoreCase("or")) { return buildOrPredicate(); } else if (booleanOperator.equalsIgnoreCase("xor")) { return buildXorPredicate(); } else if (hasSurrogation()) { return buildSurrogationPredicate(); } return null; } CompoundSegmentPredicate();  CompoundSegmentPredicate(CompoundPredicate predicate); List<String> getPredicateFieldNames(); List<String> getFieldMissingFieldNames(); String getPrimaryPredicateRule(); String getNextPredicateRule(int lastPredicate); int getSubpredicateCount(); boolean hasSurrogation(); @Override String getPredicateRule(); @Override boolean isAlwaysTrue(); @Override boolean isAlwaysFalse();  }