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

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


    handleComparator();

    if (predicates.size() == 1) {
      BasePredicate predicate = predicates.get(0);
      if (not) {
        predicate = new NotPredicate(predicate);
        not = false;
      }
      return predicate;
    }
    throw new IllegalStateException("Can't return a predicate.");
View Full Code Here


    handleComparator();

    if (predicates.size() == 1) {
      Predicate predicate = predicates.get(0);
      if (not) {
        predicate = new NotPredicate(predicate);
        not = false;
      }
      return predicate;
    }
    throw new IllegalStateException("Can't return a predicate.");
View Full Code Here

  }

  @Override
  public Predicate toPredicate() throws InvalidQueryException {
    //todo: remove need to down cast to BasePredicate
    return new NotPredicate((BasePredicate) getRightOperand().toPredicate());
  }
View Full Code Here

    return 3;
  }

  @Override
  public Predicate toPredicate(Predicate left, Predicate right) {
    return new NotPredicate((BasePredicate) right);
  }
View Full Code Here

    return TYPE.NOT_EQUAL;
  }

  @Override
  public Predicate toPredicate(String prop, String val) {
    return new NotPredicate(new EqualsPredicate<String>(prop, val));
  }
View Full Code Here

    return 3;
  }

  @Override
  public Predicate toPredicate(Predicate left, Predicate right) {
    return new NotPredicate(right);
  }
View Full Code Here

    handleComparator();

    if (predicates.size() == 1) {
      Predicate predicate = predicates.get(0);
      if (not) {
        predicate = new NotPredicate(predicate);
        not = false;
      }
      return predicate;
    }
    throw new IllegalStateException("Can't return a predicate.");
View Full Code Here

    }
  }

  @Override
  public Predicate toPredicate() throws InvalidQueryException {
    return new NotPredicate(getRightOperand().toPredicate());
  }
View Full Code Here

  }

  @Test
  public void testToPredicate() {
    EqualsPredicate p = new EqualsPredicate<String>("prop", "val");
    NotPredicate notPredicate = new NotPredicate(p);

    assertEquals(notPredicate, new NotOperator(1).toPredicate(null, p));
  }
View Full Code Here

    assertEquals("NotEqualsOperator", new NotEqualsOperator().getName());
  }

  @Test
  public void testToPredicate() {
    assertEquals(new NotPredicate(new EqualsPredicate<String>("prop", "val")),
        new NotEqualsOperator().toPredicate("prop", "val"));
  }
View Full Code Here

TOP

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

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.