Class GitPositionTransformer.Range

java.lang.Object
com.google.gerrit.server.patch.GitPositionTransformer.Range
Enclosing class:
GitPositionTransformer

public abstract static class GitPositionTransformer.Range extends Object
A range. In the context of GitPositionTransformer, this is a line range.
  • Constructor Details

    • Range

      public Range()
  • Method Details

    • start

      public abstract int start()
      Start of the range. (inclusive)
    • end

      public abstract int end()
      End of the range. (exclusive)
    • shiftBy

      public GitPositionTransformer.Range shiftBy(int amount)
      Creates a copy of this Range which is shifted by the indicated amount. A shift equally applies to both start() end end().

      Note: There's no guarantee that this method returns a new instance.

      Parameters:
      amount - amount to shift. Negative values mean moving the range up, positive values mean moving the range down.
      Returns:
      a Range instance with updated start/end
    • create

      public static GitPositionTransformer.Range create(int start, int end)