public static class

DiffRequest.Builder

extends BuilderSupport
java.lang.Object
   ↳ com.atlassian.stash.util.BuilderSupport
     ↳ com.atlassian.stash.content.DiffRequest.Builder

Summary

[Expand]
Inherited Fields
From class com.atlassian.stash.util.BuilderSupport
Public Constructors
DiffRequest.Builder(DiffRequest request)
DiffRequest.Builder(Repository repository, String untilId)
Public Methods
@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(String value, String... values)
@Nonnull DiffRequest.Builder paths(Iterable<String> values)
@Nonnull DiffRequest.Builder sinceId(String value)
Specifies the since changeset for the diff.
@Nonnull DiffRequest.Builder whitespace(DiffWhitespace value)
@Nonnull DiffRequest.Builder withComments(boolean value)
[Expand]
Inherited Methods
From class com.atlassian.stash.util.BuilderSupport
From class java.lang.Object

Public Constructors

public DiffRequest.Builder (DiffRequest request)

public DiffRequest.Builder (Repository repository, String untilId)

Public Methods

@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 (String value, String... values)

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

@Nonnull public DiffRequest.Builder sinceId (String value)

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

If the since and until changesets 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 changeset is provided, it is recommended to always use an ancestor of the until changeset.

Parameters
value the since changeset'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)