Class OptionPredicate
- java.lang.Object
-
- org.sonar.iac.docker.checks.utils.command.OptionPredicate
-
- All Implemented Interfaces:
CommandPredicate
public class OptionPredicate extends Object implements CommandPredicate
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.sonar.iac.docker.checks.utils.command.CommandPredicate
CommandPredicate.Type
-
-
Constructor Summary
Constructors Constructor Description OptionPredicate(SingularPredicate flagPredicate)OptionPredicate(SingularPredicate flagPredicate, SingularPredicate valuePredicate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OptionPredicateequalMatch(String expectedFlag, String expectedValue)booleanhasType(CommandPredicate.Type... types)true if either of the singularPredicates matchvoidmatch(PredicateContext context)
-
-
-
Constructor Detail
-
OptionPredicate
public OptionPredicate(SingularPredicate flagPredicate, SingularPredicate valuePredicate)
-
OptionPredicate
public OptionPredicate(SingularPredicate flagPredicate)
-
-
Method Detail
-
equalMatch
public static OptionPredicate equalMatch(String expectedFlag, String expectedValue)
-
hasType
public boolean hasType(CommandPredicate.Type... types)
true if either of the singularPredicates match- Specified by:
hasTypein interfaceCommandPredicate
-
match
public void match(PredicateContext context)
Used to match this predicate, by matching theflagand if it is present thevalue. The flag and value are bothSingularPredicate, for which the correspondingSingularPredicate.match(PredicateContext)is used.- Specified by:
matchin interfaceCommandPredicate
-
-