public static class

DiffRequest.Builder

extends AbstractDiffRequest.AbstractBuilder<B extends AbstractBuilder<B, R>, R>
java.lang.Object
   ↳ com.atlassian.bitbucket.util.BuilderSupport
     ↳ com.atlassian.bitbucket.content.AbstractDiffRequest.AbstractBuilder<B extends com.atlassian.bitbucket.content.AbstractDiffRequest.AbstractBuilder<B, R>, R>
       ↳ com.atlassian.bitbucket.content.DiffRequest.Builder

Summary

[Expand]
Inherited Fields
From class com.atlassian.bitbucket.util.BuilderSupport
Public Constructors
Builder(DiffRequest request)
Builder(Repository repository, String untilId)
Public Methods
@Nonnull DiffRequest.Builder autoSrcPath(boolean value)
@Nonnull DiffRequest build()
@Nonnull DiffRequest.Builder contextLines(int value)
Specifies the number of context lines to include around added/removed lines.
@Nonnull DiffRequest.Builder path(String value)
@Nonnull DiffRequest.Builder paths(Iterable<String> values)
@Nonnull DiffRequest.Builder paths(String value, String... values)
@Nonnull DiffRequest.Builder sinceId(String value)
Specifies the "since" commit for the diff.
@Nonnull DiffRequest.Builder whitespace(DiffWhitespace value)
@Nonnull DiffRequest.Builder withComments(boolean value)
Whether to include comments associated to the diff in the response to the request
Protected Methods
@Nonnull DiffRequest.Builder self()
[Expand]
Inherited Methods
From class com.atlassian.bitbucket.content.AbstractDiffRequest.AbstractBuilder
From class com.atlassian.bitbucket.util.BuilderSupport
From class java.lang.Object

Public Constructors

public Builder (DiffRequest request)

public Builder (Repository repository, String untilId)

Public Methods

@Nonnull public DiffRequest.Builder autoSrcPath (boolean value)

@Nonnull public DiffRequest build ()

@Nonnull public DiffRequest.Builder contextLines (int value)

Specifies the number of context lines to include around added/removed lines. 0 and positive values are treated as the number of lines to request. Any negative value is treated as a request for the system-configured default number of lines.

When requesting the default number of context lines, it is encouraged to use DEFAULT_CONTEXT_LINES for clarity: contextLines(DiffRequest.DEFAULT_CONTEXT_LINES).

Parameters
value the number of context lines to include around added and removed lines in the diff, which may be DEFAULT_CONTEXT_LINES to use the default number
Returns
  • this

@Nonnull public DiffRequest.Builder path (String value)

@Nonnull public DiffRequest.Builder paths (Iterable<String> values)

@Nonnull public DiffRequest.Builder paths (String value, String... values)

@Nonnull public DiffRequest.Builder sinceId (String value)

Specifies the "since" commit for the diff. Generally this is an ancestor of the "until" commit, but it is not required to be.

If the "since" and "until" commit are not directly related, the returned diff may not make sense. For example, it may show files as added, removed or modified that have not actually been changed. When an explicit "since" commit is provided, it is recommended to always use an ancestor of the "until" commit.

Parameters
value the "since" commit's ID, which will be trimmed to null if blank
Returns
  • this

@Nonnull public DiffRequest.Builder whitespace (DiffWhitespace value)

@Nonnull public DiffRequest.Builder withComments (boolean value)

Whether to include comments associated to the diff in the response to the request

Parameters
value true if the comments should be included. false otherwise.
Returns
  • this builder

Protected Methods

@Nonnull protected DiffRequest.Builder self ()