Class SuggestedFixData.Replacement

java.lang.Object
org.checkerframework.framework.source.SuggestedFixData.Replacement
Enclosing class:
SuggestedFixData

public static final class SuggestedFixData.Replacement extends Object
A single text replacement: replace the source between two offsets with new text.
  • Field Details

    • startPosition

      public final int startPosition
      Start source offset, inclusive.
    • endPosition

      public final int endPosition
      End source offset, exclusive.
    • text

      public final String text
      The replacement text (empty string to delete the range).
  • Constructor Details

    • Replacement

      public Replacement(int startPosition, int endPosition, String text)
      Creates a replacement.
      Parameters:
      startPosition - start source offset, inclusive; must be non-negative
      endPosition - end source offset, exclusive; must be at least startPosition (equal for a pure insertion)
      text - the replacement text (empty to delete)
      Throws:
      IllegalArgumentException - if startPosition is negative or endPosition is less than startPosition