Class ExpressionPredicate
- java.lang.Object
-
- org.sonar.iac.terraform.checks.utils.ExpressionPredicate
-
public class ExpressionPredicate extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Predicate<ExpressionTree>equalTo(String expected)Tests true iff the target expression is a string literal, and it's value is equal to the expected one.static ExpressionPredicategetInstance()Use singleton pattern to make use of a compiled pattern lookup mapstatic Predicate<ExpressionTree>isFalse()Tests true iff the target expression is a string literal, and it's value is false.static Predicate<ExpressionTree>isTrue()Tests true iff the target expression is a string literal, and it's value is true.static Predicate<ExpressionTree>lessThan(int other)Tests true iff the target expression is an int literal, and it's value is less than the provided.static Predicate<ExpressionTree>matchesPattern(String pattern)Tests true iff the target expression is a string literal that fully matches the case-insensitive pattern.static Predicate<ExpressionTree>matchesPattern(String pattern, int flags)Tests true iff the target expression is a string literal that fully matches the pattern.static Predicate<ExpressionTree>notEqualTo(String expected)Tests true iff the target expression is a string literal, and it's value is not equal to the expected one.
-
-
-
Method Detail
-
getInstance
public static ExpressionPredicate getInstance()
Use singleton pattern to make use of a compiled pattern lookup map
-
notEqualTo
public static Predicate<ExpressionTree> notEqualTo(String expected)
Tests true iff the target expression is a string literal, and it's value is not equal to the expected one.
-
equalTo
public static Predicate<ExpressionTree> equalTo(String expected)
Tests true iff the target expression is a string literal, and it's value is equal to the expected one.
-
matchesPattern
public static Predicate<ExpressionTree> matchesPattern(String pattern, int flags)
Tests true iff the target expression is a string literal that fully matches the pattern.
-
matchesPattern
public static Predicate<ExpressionTree> matchesPattern(String pattern)
Tests true iff the target expression is a string literal that fully matches the case-insensitive pattern.
-
isTrue
public static Predicate<ExpressionTree> isTrue()
Tests true iff the target expression is a string literal, and it's value is true.
-
isFalse
public static Predicate<ExpressionTree> isFalse()
Tests true iff the target expression is a string literal, and it's value is false.
-
lessThan
public static Predicate<ExpressionTree> lessThan(int other)
Tests true iff the target expression is an int literal, and it's value is less than the provided.
-
-