Interface Condition

All Known Implementing Classes:
AndCondition, ArrayContains, HasSize, HasValue, HasValueWithLooseType, Ignore, IsEmpty, JsonAt, JsonIsNotNull, MatcherCondition, MatchesTextCondition, MissingCondition, Not, NullCondition, NumberCondition, ObjectContainsKeys, OrCondition, PredicateWrappedCondition, TreeComparisonCondition

public interface Condition
A condition that the data must meet in order to pass the test
  • Method Summary

    Modifier and Type
    Method
    Description
    default Condition
    and(Condition other)
    Add a second condition to this one using and logic.
    Describe the condition
    default Condition
    Invert the condition - i.e.
    default Condition
    or(Condition other)
    Add a second condition to this one using or logic.
    test(com.fasterxml.jackson.databind.JsonNode json)
    Execute the test of the condition
  • Method Details

    • test

      Result test(com.fasterxml.jackson.databind.JsonNode json)
      Execute the test of the condition
      Parameters:
      json - the json to test
      Returns:
      a Result explaining whether the condition was met and if not, why not
    • describe

      String describe()
      Describe the condition
      Returns:
      description of the condition
    • and

      default Condition and(Condition other)
      Add a second condition to this one using and logic. Short-circuits so the second condition only evaluated if the first is true
      Parameters:
      other - the other one
      Returns:
      the combined condition
    • or

      default Condition or(Condition other)
      Add a second condition to this one using or logic. Short-circuits so the second condition only evaluated if the first is false
      Parameters:
      other - the other one
      Returns:
      the combined condition
    • inverted

      default Condition inverted()
      Invert the condition - i.e. wrap it in a not
      Returns:
      the opposite of the condition