Package com.google.errorprone.fixes
Class Replacement
java.lang.Object
com.google.errorprone.fixes.Replacement
public abstract class Replacement extends Object
A replaced section of a source file.
-
Constructor Summary
Constructors Constructor Description Replacement()
-
Method Summary
Modifier and Type Method Description static Replacement
create(int startPosition, int endPosition, String replaceWith)
Creates aReplacement
.int
endPosition()
The end of the replacement range, exclusive.int
length()
The length of the input text to be replaced.abstract com.google.common.collect.Range<Integer>
range()
TheRange
to be replaced.abstract String
replaceWith()
The source text to appear in the output.int
startPosition()
The beginning of the replacement range.
-
Constructor Details
-
Replacement
public Replacement()
-
-
Method Details
-
create
Creates aReplacement
. Start and end positions are represented as code unit indices in a Unicode 16-bit string.- Parameters:
startPosition
- the beginning of the replacementendPosition
- the end of the replacement, exclusivereplaceWith
- the replacement text
-
startPosition
public int startPosition()The beginning of the replacement range. -
length
public int length()The length of the input text to be replaced. -
endPosition
public int endPosition()The end of the replacement range, exclusive. -
range
TheRange
to be replaced. -
replaceWith
The source text to appear in the output.
-