Skip to main content

Criteria builder

The CriteriaBuilder is a utility class designed to build objects used in creating query criteria in a Groovy expression format. These criteria can be used in requests to back-end services.

Methods

info

The examples for these methods use a simple expression that checks that TRADE_ID equals a certain value.

const tradeIdEqualsExpression = new ExpressionBuilder()
.withField('TRADE_ID')
.withValue('TR1234')
.withSerialiser(Serialisers.EQ)
.build()
MethodDescriptionParamsReturn valueExample
withExpressionSets an expression in the criteriaValidExpressionType, ExpressionOptions, Join (default Join.And)CriteriaBuilder
new CriteriaBuilder().withExpression(tradeIdEqualsExpression)
AndSets an expression with an And clauseValidExpressionType, ExpressionOptionsCriteriaBuilder
new CriteriaBuilder()
.And(tradeIdEqualsExpression)
OrSets an expression with an Or clauseValidExpressionType, ExpressionOptionsCriteriaBuilder
new CriteriaBuilder().OR(tradeIdEqualsExpression)
NotSets an expression with a Not clauseValidExpressionType, ExpressionOptionsCriteriaBuilder
new CriteriaBuilder().NOT(tradeIdEqualsExpression)
BuildCreates a string representation of based on the set expressions in the objectnonestring
new CriteriaBuilder()
.withExpression(tradeIdEqualsExpression)
.build();