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

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


    switch (operator) {
      case And:
        predicate = new AndPredicate(predicates.toArray(new BasePredicate[predicates.size()]));
        break;
      case Or:
        predicate = new OrPredicate(predicates.toArray(new BasePredicate[predicates.size()]));
        break;
      default:
        throw new IllegalStateException("Unknown operator " + this.operator);
    }
    predicates.clear();
View Full Code Here


        left : AndPredicate.instance(left, right));
  }

  private static List<BasePredicate> distributeOr(OrPredicate orPredicate, BasePredicate other) {
    List<BasePredicate> andPredicateList = new LinkedList<BasePredicate>();
    OrPredicate otherOr = null;

    if (other instanceof OrPredicate) {
      otherOr = (OrPredicate) other;
    }
View Full Code Here

    switch (operator) {
      case And:
        predicate = new AndPredicate(predicates.toArray(new Predicate[predicates.size()]));
        break;
      case Or:
        predicate = new OrPredicate(predicates.toArray(new Predicate[predicates.size()]));
        break;
      default:
        throw new IllegalStateException("Unknown operator " + this.operator);
    }
    predicates.clear();
View Full Code Here

    Predicate andPredicate1 = new AndPredicate(namePredicate, depServicePredicate,
        depCompPredicate, stackNamePredicate, stackVersionPredicate);
    Predicate andPredicate2 = new AndPredicate(name2Predicate, depServicePredicate,
        depCompPredicate, stackNamePredicate, stackVersionPredicate);
    Predicate orPredicate = new OrPredicate(andPredicate1, andPredicate2);

    //mock expectations
    expect(metaInfo.getComponentDependency("stack_name", "stack_version", "dep_service_name",
        "dep_comp_name", "comp_name")).andReturn(dependencyInfo);
    expect(metaInfo.getComponentDependency("stack_name", "stack_version", "dep_service_name",
View Full Code Here

        left : AndPredicate.instance(left, right));
  }

  private static List<BasePredicate> distributeOr(OrPredicate orPredicate, BasePredicate other) {
    List<BasePredicate> andPredicateList = new LinkedList<BasePredicate>();
    OrPredicate otherOr = null;

    if (other instanceof OrPredicate) {
      otherOr = (OrPredicate) other;
    }
View Full Code Here

        left : AndPredicate.instance(left, right));
  }

  private static List<BasePredicate> distributeOr(OrPredicate orPredicate, BasePredicate other) {
    List<BasePredicate> andPredicateList = new LinkedList<BasePredicate>();
    OrPredicate otherOr = null;

    if (other instanceof OrPredicate) {
      otherOr = (OrPredicate) other;
    }
View Full Code Here

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

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

  }

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

    switch (operator) {
      case And:
        predicate = new AndPredicate(predicates.toArray(new Predicate[predicates.size()]));
        break;
      case Or:
        predicate = new OrPredicate(predicates.toArray(new Predicate[predicates.size()]));
        break;
      default:
        throw new IllegalStateException("Unknown operator " + this.operator);
    }
    predicates.clear();
View Full Code Here

        left : AndPredicate.instance(left, right));
  }

  private static List<Predicate> distributeOr(OrPredicate orPredicate, Predicate other) {
    List<Predicate> andPredicateList = new LinkedList<Predicate>();
    OrPredicate otherOr = null;

    if (other instanceof OrPredicate) {
      otherOr = (OrPredicate) other;
    }
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.