Record Class AdjustedPosition
java.lang.Object
java.lang.Record
com.google.errorprone.fixes.AdjustedPosition
- All Implemented Interfaces:
ErrorPronePosition
public record AdjustedPosition(com.sun.tools.javac.tree.JCTree position, int startPositionAdjustment, int endPositionAdjustment)
extends Record
implements ErrorPronePosition
Describes a tree position with adjustments to the start and end indices.
-
Constructor Summary
ConstructorsConstructorDescriptionAdjustedPosition(com.sun.tools.javac.tree.JCTree position, int startPositionAdjustment, int endPositionAdjustment) Creates an instance of aAdjustedPositionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theendPositionAdjustmentrecord component.final booleanIndicates whether some other object is "equal to" this one.intgetEndPosition(ErrorProneEndPosTable endPositions) intgetEndPosition(com.sun.tools.javac.tree.EndPosTable endPositions) intintcom.sun.tools.javac.tree.JCTreegetTree()final inthashCode()Returns a hash code value for this object.com.sun.tools.javac.tree.JCTreeposition()Returns the value of thepositionrecord component.intReturns the value of thestartPositionAdjustmentrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AdjustedPosition
public AdjustedPosition(com.sun.tools.javac.tree.JCTree position, int startPositionAdjustment, int endPositionAdjustment) Creates an instance of aAdjustedPositionrecord class.- Parameters:
position- the value for thepositionrecord componentstartPositionAdjustment- the value for thestartPositionAdjustmentrecord componentendPositionAdjustment- the value for theendPositionAdjustmentrecord component
-
-
Method Details
-
getStartPosition
public int getStartPosition()- Specified by:
getStartPositionin interfaceErrorPronePosition
-
getTree
public com.sun.tools.javac.tree.JCTree getTree()- Specified by:
getTreein interfaceErrorPronePosition
-
getPreferredPosition
public int getPreferredPosition()- Specified by:
getPreferredPositionin interfaceErrorPronePosition
-
getEndPosition
public int getEndPosition(com.sun.tools.javac.tree.EndPosTable endPositions) -
getEndPosition
- Specified by:
getEndPositionin interfaceErrorPronePosition
-
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. -
position
public com.sun.tools.javac.tree.JCTree position()Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
startPositionAdjustment
public int startPositionAdjustment()Returns the value of thestartPositionAdjustmentrecord component.- Returns:
- the value of the
startPositionAdjustmentrecord component
-
endPositionAdjustment
public int endPositionAdjustment()Returns the value of theendPositionAdjustmentrecord component.- Returns:
- the value of the
endPositionAdjustmentrecord component
-