public final class ExpressionUtils
extends Object
Internal utility class for extracting a boolean expression from the given expression or statement.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static String |
describeStatementKind(Statement statement)Names the kind of the given statement for an error message, in the plural: "return statements"
for a return statement, "try-catch statements" for a try statement. |
|
public static List<BooleanExpression> |
getBooleanExpression(ClosureExpression closureExpression)Returns all BooleanExpression instances found in the given ClosureExpression. |
|
public static BooleanExpression |
getBooleanExpression(List<BooleanExpression> booleanExpressions)Collapses the supplied boolean expressions into a single expression combined with logical AND. |
|
public static List<BooleanExpression> |
getBooleanExpressionsFromAssertionStatements(BlockStatement blockStatement)Returns all BooleanExpression instances found in the given BlockStatement. |
Names the kind of the given statement for an error message, in the plural: "return statements"
for a return statement, "try-catch statements" for a try statement.
statement - the statement to describeReturns all BooleanExpression instances found in the given ClosureExpression. A statement that is not an expression statement holds no condition and is left out; callers report such a statement before asking for the conditions.
Collapses the supplied boolean expressions into a single expression combined with logical AND.
booleanExpressions - the expressions to combinetrue if the input is emptyReturns all BooleanExpression instances found in the given BlockStatement.