Class CompoundAssignment

java.lang.Object
com.google.errorprone.matchers.CompoundAssignment
All Implemented Interfaces:
Matcher<com.sun.source.tree.CompoundAssignmentTree>, Serializable

public class CompoundAssignment extends Object implements Matcher<com.sun.source.tree.CompoundAssignmentTree>
Matcher for a compound-assignment operator expression.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    CompoundAssignment(Set<com.sun.source.tree.Tree.Kind> operators, Matcher<com.sun.source.tree.ExpressionTree> receiverMatcher, Matcher<com.sun.source.tree.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 Type
    Method
    Description
    boolean
    matches(com.sun.source.tree.CompoundAssignmentTree compoundAssignmentTree, VisitorState state)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CompoundAssignment

      public CompoundAssignment(Set<com.sun.source.tree.Tree.Kind> operators, Matcher<com.sun.source.tree.ExpressionTree> receiverMatcher, Matcher<com.sun.source.tree.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 the Tree.Kind enum values which link to CompoundAssignmentTree 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

      public boolean matches(com.sun.source.tree.CompoundAssignmentTree compoundAssignmentTree, VisitorState state)
      Specified by:
      matches in interface Matcher<com.sun.source.tree.CompoundAssignmentTree>