Package org.sonar.python.checks.cdk
Class CdkPredicate
- java.lang.Object
-
- org.sonar.python.checks.cdk.CdkPredicate
-
public class CdkPredicate extends Object
-
-
Method Summary
-
-
-
Method Detail
-
isFalse
public static Predicate<Expression> isFalse()
- Returns:
- Predicate which tests if expression is boolean literal and is set to `false`
-
isTrue
public static Predicate<Expression> isTrue()
- Returns:
- Predicate which tests if expression is boolean literal and is set to `true`
-
isNone
public static Predicate<Expression> isNone()
- Returns:
- Predicate which tests if expression is `none`
-
isFqn
public static Predicate<Expression> isFqn(String fqnValue)
- Returns:
- Predicate which tests if expression is a fully qualified name (FQN) and is equal the expected FQN
-
isFqnOf
public static Predicate<Expression> isFqnOf(Collection<String> fqnValues)
- Returns:
- Predicate which tests if expression is a fully qualified name (FQN) and part of the FQN list
-
isString
public static Predicate<Expression> isString(String expectedValue)
- Returns:
- Predicate which tests if expression is a string and is equal the expected value
-
isWildcard
public static Predicate<Expression> isWildcard()
-
isString
public static Predicate<Expression> isString(Set<String> expectedValues)
- Returns:
- Predicate which tests if expression is a string and is equal to any of the expected values
-
matches
public static Predicate<Expression> matches(Pattern pattern)
- Returns:
- Predicate which tests if expression is a string matches the pattern
-
isStringLiteral
public static Predicate<Expression> isStringLiteral()
- Returns:
- Predicate which tests if expression is a string literal
-
isNumericLiteral
public static Predicate<Expression> isNumericLiteral()
- Returns:
- Predicate which tests if expression is a number literal
-
isListLiteral
public static Predicate<Expression> isListLiteral()
- Returns:
- Predicate which tests if expression is a list literal
-
isSubscriptionExpression
public static Predicate<Expression> isSubscriptionExpression()
-
startsWith
public static Predicate<Expression> startsWith(String expected)
- Returns:
- Predicate which tests if expression is a string and starts with the expected value
-
isCallExpression
public static Predicate<Expression> 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
public static Predicate<Expression> isNumeric(Set<Long> vals)
-
-