Package org.sonar.python.checks.cdk
Class CdkPredicate
java.lang.Object
org.sonar.python.checks.cdk.CdkPredicate
-
Method Summary
Modifier and TypeMethodDescriptionstatic Predicate<Expression>hasArgument(String name, int pos, Predicate<Expression>... predicates) static Predicate<Expression>hasArgument(String name, Predicate<Expression>... predicates) static Predicate<Expression>hasIntervalArguments(String argNameMin, int argPosMin, String argNameMax, int argPosMax, Collection<Long> values) static Predicate<Expression>hasIntervalArguments(String argNameMin, String argNameMax, Collection<Long> values) static Predicate<Expression>static Predicate<Expression>isFalse()static Predicate<Expression>static Predicate<Expression>isFqnOf(Collection<String> fqnValues) static Predicate<Expression>static Predicate<Expression>isNone()static Predicate<Expression>static Predicate<Expression>static Predicate<Expression>static Predicate<Expression>static Predicate<Expression>static Predicate<Expression>static Predicate<Expression>isTrue()static Predicate<Expression>static Predicate<Expression>static Predicate<Expression>startsWith(String expected)
-
Method Details
-
isFalse
- Returns:
- Predicate which tests if expression is boolean literal and is set to `false`
-
isTrue
- Returns:
- Predicate which tests if expression is boolean literal and is set to `true`
-
isNone
- Returns:
- Predicate which tests if expression is `none`
-
isFqn
- Returns:
- Predicate which tests if expression is a fully qualified name (FQN) and is equal the expected FQN
-
isFqnOf
- Returns:
- Predicate which tests if expression is a fully qualified name (FQN) and part of the FQN list
-
isString
- Returns:
- Predicate which tests if expression is a string and is equal the expected value
-
isWildcard
-
isString
- Returns:
- Predicate which tests if expression is a string and is equal to any of the expected values
-
matches
- Returns:
- Predicate which tests if expression is a string matches the pattern
-
isStringLiteral
- Returns:
- Predicate which tests if expression is a string literal
-
isNumericLiteral
- Returns:
- Predicate which tests if expression is a number literal
-
isListLiteral
- Returns:
- Predicate which tests if expression is a list literal
-
isSubscriptionExpression
-
startsWith
- Returns:
- Predicate which tests if expression is a string and starts with the expected value
-
isCallExpression
-
hasArgument
@SafeVarargs public static Predicate<Expression> hasArgument(String name, int pos, Predicate<Expression>... predicates) -
hasArgument
@SafeVarargs public static Predicate<Expression> hasArgument(String name, Predicate<Expression>... predicates) -
hasIntervalArguments
public static Predicate<Expression> hasIntervalArguments(String argNameMin, int argPosMin, String argNameMax, int argPosMax, Collection<Long> values) -
hasIntervalArguments
public static Predicate<Expression> hasIntervalArguments(String argNameMin, String argNameMax, Collection<Long> values) -
isNumeric
-