Record Class Commented
java.lang.Object
java.lang.Record
com.google.errorprone.util.Commented
public record Commented(Tree tree, com.google.common.collect.ImmutableList<ErrorProneComment> beforeComments, com.google.common.collect.ImmutableList<ErrorProneComment> afterComments)
extends Record
Class to hold AST nodes annotated with the comments that are associated with them
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumIdentifies the position of a comment relative to the associated treenode. -
Constructor Summary
ConstructorsConstructorDescriptionCommented(Tree tree, com.google.common.collect.ImmutableList<ErrorProneComment> beforeComments, com.google.common.collect.ImmutableList<ErrorProneComment> afterComments) Creates an instance of aCommentedrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableList<ErrorProneComment> Returns the value of theafterCommentsrecord component.com.google.common.collect.ImmutableList<ErrorProneComment> Returns the value of thebeforeCommentsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.tree()Returns the value of thetreerecord component.
-
Constructor Details
-
Commented
public Commented(Tree tree, com.google.common.collect.ImmutableList<ErrorProneComment> beforeComments, com.google.common.collect.ImmutableList<ErrorProneComment> afterComments) Creates an instance of aCommentedrecord class.- Parameters:
tree- the value for thetreerecord componentbeforeComments- the value for thebeforeCommentsrecord componentafterComments- the value for theafterCommentsrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
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. All components in this record class are compared withObjects::equals(Object,Object). -
tree
Returns the value of thetreerecord component.- Returns:
- the value of the
treerecord component
-
beforeComments
Returns the value of thebeforeCommentsrecord component.- Returns:
- the value of the
beforeCommentsrecord component
-
afterComments
Returns the value of theafterCommentsrecord component.- Returns:
- the value of the
afterCommentsrecord component
-