Skip to content

Built in predicates

Esta Nagy edited this page Jun 19, 2020 · 6 revisions

Here you can find all Predicates defined as part of the standard package.

How to use this document...

Predicates have a single purpose of evaluating input values and returning boolean values. This might or might not need any additional configuration as you will see form our examples.

Each predicate has a version when it was added to the app, a class implementing them, a name they are registered with, an input type, a parameter list defining how they can be configured, a description stating what they are supposed to do, and we will show an example configuration as well.

Predicate implementations

Any String predicate

Name: anyString

Class: AnyStringPredicate

Since version: 1.0.0

Input type: String

Parameters: none

Description

This predicate returns true for any String.

Example configuration

name: "replace"
path: "$.accounts..lastName"
params:
  stringFunction:
    name: "regex"
    pattern: (?<firstName>[A-Za-z\-]+) (?<lastName>[A-Za-z\-]+)
    replacement: "${lastName}"
  predicate: # this is the node defining our predicate
    name: "anyString"

This example will match any String, essentially including all String nodes the JsonPath of our rule matches.