Record Class MultiMatcher.MultiMatchResult<N extends Tree>

java.lang.Object
java.lang.Record
com.google.errorprone.matchers.MultiMatcher.MultiMatchResult<N>
Record Components:
matches - True if the MultiMatcher matched the nodes expected.
matchingNodes - The list of nodes which matched the MultiMatcher's expectations (could be empty if the match type was ALL and there were no child nodes). Only sensical if matches() is true.
Enclosing interface:
MultiMatcher<T extends Tree, N extends Tree>

public static record MultiMatcher.MultiMatchResult<N extends Tree>(boolean matches, com.google.common.collect.ImmutableList<N extends Tree> matchingNodes) extends Record
A result from the call of MultiMatcher.multiMatchResult(Tree, VisitorState), containing information about whether it matched, and if so, what nodes matched.
Author:
eaftan@google.com (Eddie Aftandilian)
  • Constructor Summary

    Constructors
    Constructor
    Description
    MultiMatchResult(boolean matches, com.google.common.collect.ImmutableList<N> matchingNodes)
    Creates an instance of a MultiMatchResult record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the matches record component.
    com.google.common.collect.ImmutableList<N>
    Returns the value of the matchingNodes record component.
    final N
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MultiMatchResult

      public MultiMatchResult(boolean matches, com.google.common.collect.ImmutableList<N> matchingNodes)
      Creates an instance of a MultiMatchResult record class.
      Parameters:
      matches - the value for the matches record component
      matchingNodes - the value for the matchingNodes record component
  • Method Details

    • onlyMatchingNode

      public final N onlyMatchingNode()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • matches

      public boolean matches()
      Returns the value of the matches record component.
      Returns:
      the value of the matches record component
    • matchingNodes

      public com.google.common.collect.ImmutableList<N> matchingNodes()
      Returns the value of the matchingNodes record component.
      Returns:
      the value of the matchingNodes record component