Package org.apache.ambari.server.controller.predicate

Examples of org.apache.ambari.server.controller.predicate.OrPredicate


    return listPredicates.size() == 1 ? listPredicates.get(0) :
        buildOrPredicate(listPredicates);
  }

  private OrPredicate buildOrPredicate(List<EqualsPredicate> listPredicates) {
    return new OrPredicate(listPredicates.toArray(new Predicate[listPredicates.size()]));
  }
View Full Code Here


  }

  @Override
  public Predicate toPredicate(Predicate left, Predicate right) {
    //todo: refactor to remove down casts
    return new OrPredicate(left, right);
  }
View Full Code Here

  @Test
  public void testToPredicate() {
    EqualsPredicate p1 = new EqualsPredicate<String>("p1", "one");
    EqualsPredicate p2 = new EqualsPredicate<String>("p2", "two");
    OrPredicate orPRedicate = new OrPredicate(p1, p2);

    assertEquals(orPRedicate, new OrOperator(1).toPredicate(p1, p2));
  }
View Full Code Here

    String prop = "prop";
    String val = "one,2,three";
    EqualsPredicate p1 = new EqualsPredicate<String>(prop, "one");
    EqualsPredicate p2 = new EqualsPredicate<String>(prop, "2");
    EqualsPredicate p3 = new EqualsPredicate<String>(prop, "three");
    OrPredicate orPredicate = new OrPredicate(p1, p2, p3);

    assertEquals(orPredicate, new InOperator().toPredicate(prop, val));
  }
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.controller.predicate.OrPredicate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.