java.lang.Object
uk.org.webcompere.modelassert.json.condition.tree.PathRule

public class PathRule extends Object
Dictates a TreeRule that applies at a given path match and any operand for that rule
  • Constructor Details

    • PathRule

      public PathRule(TreeRule rule)
      Constructed with a stateless tree rule for everywhere
      Parameters:
      rule - the rule
    • PathRule

      public PathRule(PathMatch pathMatch, TreeRule rule)
      Construct to apply a rule to a path
      Parameters:
      pathMatch - the path the rule applies to
      rule - the rule to apply - no operand
    • PathRule

      public PathRule(PathMatch pathMatch, Condition ruleCondition)
      Construct to apply a condition rule to a path
      Parameters:
      pathMatch - the path the rule applies to
      ruleCondition - the condition to apply
  • Method Details

    • matches

      public boolean matches(Location location)
      Does this rule apply to this location
      Parameters:
      location - the location to test
      Returns:
      true when the rule applies
    • getRule

      public TreeRule getRule()
      Get the rule type
      Returns:
      the type of rule
    • getRuleCondition

      public Condition getRuleCondition()
      Get any condition associated with the rule
      Returns:
      condition
    • toString

      public String toString()
      Overrides:
      toString in class Object