Record Class FixedPosition
java.lang.Object
java.lang.Record
com.google.errorprone.fixes.FixedPosition
- All Implemented Interfaces:
ErrorPronePosition
public record FixedPosition(com.sun.tools.javac.tree.JCTree tree, int startPosition, int endPosition)
extends Record
implements ErrorPronePosition
A
JCDiagnostic.DiagnosticPosition with a fixed position.-
Constructor Summary
ConstructorsConstructorDescriptionFixedPosition(Tree tree, int startPosition) FixedPosition(Tree tree, int startPosition, int endPosition) FixedPosition(com.sun.tools.javac.tree.JCTree tree, int startPosition, int endPosition) Creates an instance of aFixedPositionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theendPositionrecord component.final booleanIndicates whether some other object is "equal to" this one.intgetEndPosition(ErrorProneEndPosTable endPosTable) intgetEndPosition(com.sun.tools.javac.tree.EndPosTable endPosTable) intintcom.sun.tools.javac.tree.JCTreegetTree()final inthashCode()Returns a hash code value for this object.intReturns the value of thestartPositionrecord component.final StringtoString()Returns a string representation of this record class.com.sun.tools.javac.tree.JCTreetree()Returns the value of thetreerecord component.
-
Constructor Details
-
FixedPosition
-
FixedPosition
-
FixedPosition
public FixedPosition(com.sun.tools.javac.tree.JCTree tree, int startPosition, int endPosition) Creates an instance of aFixedPositionrecord class.- Parameters:
tree- the value for thetreerecord componentstartPosition- the value for thestartPositionrecord componentendPosition- the value for theendPositionrecord component
-
-
Method Details
-
getTree
public com.sun.tools.javac.tree.JCTree getTree()- Specified by:
getTreein interfaceErrorPronePosition
-
getStartPosition
public int getStartPosition()- Specified by:
getStartPositionin interfaceErrorPronePosition
-
getPreferredPosition
public int getPreferredPosition()- Specified by:
getPreferredPositionin interfaceErrorPronePosition
-
getEndPosition
- Specified by:
getEndPositionin interfaceErrorPronePosition
-
getEndPosition
public int getEndPosition(com.sun.tools.javac.tree.EndPosTable endPosTable) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
tree
public com.sun.tools.javac.tree.JCTree tree()Returns the value of thetreerecord component.- Returns:
- the value of the
treerecord component
-
startPosition
public int startPosition()Returns the value of thestartPositionrecord component.- Returns:
- the value of the
startPositionrecord component
-
endPosition
public int endPosition()Returns the value of theendPositionrecord component.- Returns:
- the value of the
endPositionrecord component
-