Package org.apache.groovy.contracts.util
Class ExpressionUtils
java.lang.Object
org.apache.groovy.contracts.util.ExpressionUtils
Internal utility class for extracting a boolean expression from the given expression or statement.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic BooleanExpressiongetBooleanExpression(List<BooleanExpression> booleanExpressions) Collapses the supplied boolean expressions into a single expression combined with logical AND.static List<BooleanExpression>getBooleanExpression(ClosureExpression closureExpression) Returns allBooleanExpressioninstances found in the givenClosureExpression.static List<BooleanExpression>getBooleanExpressionsFromAssertionStatements(BlockStatement blockStatement) Returns allBooleanExpressioninstances found in the givenBlockStatement.
-
Method Details
-
getBooleanExpression
Returns allBooleanExpressioninstances found in the givenClosureExpression. -
getBooleanExpressionsFromAssertionStatements
public static List<BooleanExpression> getBooleanExpressionsFromAssertionStatements(BlockStatement blockStatement) Returns allBooleanExpressioninstances found in the givenBlockStatement. -
getBooleanExpression
Collapses the supplied boolean expressions into a single expression combined with logical AND.- Parameters:
booleanExpressions- the expressions to combine- Returns:
- the combined expression, or
trueif the input is empty
-