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

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


    if (predicate instanceof ArrayPredicate) {
      ArrayPredicate arrayPredicate  = (ArrayPredicate) predicate;
      for (Predicate predicateItem : arrayPredicate.getPredicates()) {
          if (predicateItem instanceof EqualsPredicate) {
            EqualsPredicate equalsPredicate =
                (EqualsPredicate) predicateItem;
            if (queryParameterId.equals(equalsPredicate.getPropertyId())) {
              return equalsPredicate.getValue();
            }
          } else {
            result = getQueryParameterValue(queryParameterId, predicateItem);
            if (result != null) {
              return result;
View Full Code Here


    if (predicate instanceof ArrayPredicate) {
      ArrayPredicate arrayPredicate  = (ArrayPredicate) predicate;
      for (Predicate predicateItem : arrayPredicate.getPredicates()) {
          if (predicateItem instanceof EqualsPredicate) {
            EqualsPredicate equalsPredicate =
                (EqualsPredicate) predicateItem;
            if (queryParameterId.equals(equalsPredicate.getPropertyId())) {
              return equalsPredicate.getValue();
            }
          } else {
            result = getQueryParameterValue(queryParameterId, predicateItem);
            if (result != null) {
              return result;
View Full Code Here

    if (predicate instanceof ArrayPredicate) {
      ArrayPredicate arrayPredicate  = (ArrayPredicate) predicate;
      for (Predicate predicateItem : arrayPredicate.getPredicates()) {
          if (predicateItem instanceof EqualsPredicate) {
            EqualsPredicate equalsPredicate =
                (EqualsPredicate) predicateItem;
            if (queryParameterId.equals(equalsPredicate.getPropertyId())) {
              return equalsPredicate.getValue();
            }
          } else {
            result = getQueryParameterValue(queryParameterId, predicateItem);
            if (result != null) {
              return result;
View Full Code Here

    if (predicate instanceof ArrayPredicate) {
      ArrayPredicate arrayPredicate  = (ArrayPredicate) predicate;
      for (Predicate predicateItem : arrayPredicate.getPredicates()) {
          if (predicateItem instanceof EqualsPredicate) {
            EqualsPredicate equalsPredicate =
                (EqualsPredicate) predicateItem;
            if (queryParameterId.equals(equalsPredicate.getPropertyId())) {
              return equalsPredicate.getValue();
            }
          } else {
            result = getQueryParameterValue(queryParameterId, predicateItem);
            if (result != null) {
              return result;
View Full Code Here

    }

    String[] tokens = val.split(",");
    List<EqualsPredicate> listPredicates = new ArrayList<EqualsPredicate>();
    for (String token : tokens) {
      listPredicates.add(new EqualsPredicate(prop, token.trim()));
    }
    return listPredicates.size() == 1 ? listPredicates.get(0) :
        buildOrPredicate(listPredicates);
  }
View Full Code Here

    if (predicate instanceof ArrayPredicate) {
      ArrayPredicate arrayPredicate  = (ArrayPredicate) predicate;
      for (Predicate predicateItem : arrayPredicate.getPredicates()) {
          if (predicateItem instanceof EqualsPredicate) {
            EqualsPredicate equalsPredicate =
                (EqualsPredicate) predicateItem;
            if (queryParameterId.equals(equalsPredicate.getPropertyId())) {
              return equalsPredicate.getValue();
            }
          } else {
            result = getQueryParameterValue(queryParameterId, predicateItem);
            if (result != null) {
              return result;
View Full Code Here

    if (predicate instanceof ArrayPredicate) {
      ArrayPredicate arrayPredicate  = (ArrayPredicate) predicate;
      for (Predicate predicateItem : arrayPredicate.getPredicates()) {
          if (predicateItem instanceof EqualsPredicate) {
            EqualsPredicate equalsPredicate =
                (EqualsPredicate) predicateItem;
            if (queryParameterId.equals(equalsPredicate.getPropertyId())) {
              return equalsPredicate.getValue();
            }
          } else {
            result = getQueryParameterValue(queryParameterId, predicateItem);
            if (result != null) {
              return result;
View Full Code Here

    }

    String[] tokens = val.split(",");
    List<EqualsPredicate> listPredicates = new ArrayList<EqualsPredicate>();
    for (String token : tokens) {
      listPredicates.add(new EqualsPredicate(prop, token.trim()));
    }
    return listPredicates.size() == 1 ? listPredicates.get(0) :
        buildOrPredicate(listPredicates);
  }
View Full Code Here

    if (predicate instanceof ArrayPredicate) {
      ArrayPredicate arrayPredicate  = (ArrayPredicate) predicate;
      for (Predicate predicateItem : arrayPredicate.getPredicates()) {
          if (predicateItem instanceof EqualsPredicate) {
            EqualsPredicate equalsPredicate =
                (EqualsPredicate) predicateItem;
            if (queryParameterId.equals(equalsPredicate.getPropertyId())) {
              return equalsPredicate.getValue();
            }
          } else {
            result = getQueryParameterValue(queryParameterId, predicateItem);
            if (result != null) {
              return result;
View Full Code Here

    assertEquals("AndOperator", new AndOperator(1).getName());
  }

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

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

TOP

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

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.