Interface DiffHunk.Builder

All Superinterfaces:
Buildable, CopyableBuilder<DiffHunk.Builder,DiffHunk>, SdkBuilder<DiffHunk.Builder,DiffHunk>, SdkPojo
Enclosing class:
DiffHunk

@Mutable @NotThreadSafe public static interface DiffHunk.Builder extends SdkPojo, CopyableBuilder<DiffHunk.Builder,DiffHunk>
  • Method Details

    • beforeStartLine

      DiffHunk.Builder beforeStartLine(Integer beforeStartLine)

      The 1-based line number in the before blob where this hunk begins. When the hunk consists entirely of additions, beforeLineCount is 0.

      Parameters:
      beforeStartLine - The 1-based line number in the before blob where this hunk begins. When the hunk consists entirely of additions, beforeLineCount is 0.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • beforeLineCount

      DiffHunk.Builder beforeLineCount(Integer beforeLineCount)

      The number of lines from the before blob covered by this hunk, including any context lines.

      Parameters:
      beforeLineCount - The number of lines from the before blob covered by this hunk, including any context lines.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • afterStartLine

      DiffHunk.Builder afterStartLine(Integer afterStartLine)

      The 1-based line number in the after blob where this hunk begins. When the hunk consists entirely of deletions, afterLineCount is 0.

      Parameters:
      afterStartLine - The 1-based line number in the after blob where this hunk begins. When the hunk consists entirely of deletions, afterLineCount is 0.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • afterLineCount

      DiffHunk.Builder afterLineCount(Integer afterLineCount)

      The number of lines from the after blob covered by this hunk, including any context lines.

      Parameters:
      afterLineCount - The number of lines from the after blob covered by this hunk, including any context lines.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • changes

      An ordered list of line-level changes that make up this hunk. Each entry indicates whether the line is unchanged context, an addition, or a deletion.

      Parameters:
      changes - An ordered list of line-level changes that make up this hunk. Each entry indicates whether the line is unchanged context, an addition, or a deletion.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • changes

      DiffHunk.Builder changes(DiffChange... changes)

      An ordered list of line-level changes that make up this hunk. Each entry indicates whether the line is unchanged context, an addition, or a deletion.

      Parameters:
      changes - An ordered list of line-level changes that make up this hunk. Each entry indicates whether the line is unchanged context, an addition, or a deletion.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • changes

      An ordered list of line-level changes that make up this hunk. Each entry indicates whether the line is unchanged context, an addition, or a deletion.

      This is a convenience method that creates an instance of the DiffChange.Builder avoiding the need to create one manually via DiffChange.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to changes(List<DiffChange>).

      Parameters:
      changes - a consumer that will call methods on DiffChange.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also: