Class CompoundAssignment
java.lang.Object
com.google.errorprone.matchers.CompoundAssignment
- All Implemented Interfaces:
Matcher<CompoundAssignmentTree>, Serializable
Matcher for a compound-assignment operator expression.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCompoundAssignment
(Set<Tree.Kind> operators, Matcher<ExpressionTree> receiverMatcher, Matcher<ExpressionTree> expressionMatcher) Creates a new compound-assignment operator matcher, which matches a compound assignment expression with one of a set of operators and whose receiver and expression match the given matchers. -
Method Summary
Modifier and TypeMethodDescriptionboolean
matches
(CompoundAssignmentTree compoundAssignmentTree, VisitorState state)
-
Constructor Details
-
CompoundAssignment
public CompoundAssignment(Set<Tree.Kind> operators, Matcher<ExpressionTree> receiverMatcher, Matcher<ExpressionTree> expressionMatcher) Creates a new compound-assignment operator matcher, which matches a compound assignment expression with one of a set of operators and whose receiver and expression match the given matchers.- Parameters:
operators
- The set of matching compound-assignment operators. These are drawn from theTree.Kind
enum values which link toCompoundAssignmentTree
in their javadoc.receiverMatcher
- The matcher which must match the receiver which will be assigned to.expressionMatcher
- The matcher which must match the right-hand expression to the compound assignment.
-
-
Method Details
-
matches
- Specified by:
matches
in interfaceMatcher<CompoundAssignmentTree>
-