public static class DiffRequest.Builder extends AbstractDiffRequest.AbstractBuilder<DiffRequest.Builder,DiffRequest>
NOT_BLANK
Constructor and Description |
---|
Builder(DiffRequest request) |
Builder(Repository repository,
String untilId) |
Modifier and Type | Method and Description |
---|---|
DiffRequest.Builder |
autoSrcPath(boolean value) |
DiffRequest |
build() |
DiffRequest.Builder |
contextLines(int value)
Specifies the number of context lines to include around added/removed lines.
|
DiffRequest.Builder |
path(String value) |
DiffRequest.Builder |
paths(Iterable<String> values) |
DiffRequest.Builder |
paths(String value,
String... values) |
DiffRequest.Builder |
secondaryRepository(Repository value) |
protected DiffRequest.Builder |
self() |
DiffRequest.Builder |
sinceId(String value)
Specifies the "since" commit for the diff.
|
DiffRequest.Builder |
whitespace(DiffWhitespace value) |
DiffRequest.Builder |
withComments(boolean value)
Whether to include comments associated to the diff in the response to the request
|
filter
addIf, addIf, addIf, addIf, addIf, addIf, checkNotBlank, requireNonBlank
public Builder(@Nonnull DiffRequest request)
public Builder(@Nonnull Repository repository, @Nonnull String untilId)
@Nonnull public DiffRequest.Builder autoSrcPath(boolean value)
@Nonnull public DiffRequest build()
build
in class AbstractDiffRequest.AbstractBuilder<DiffRequest.Builder,DiffRequest>
@Nonnull public DiffRequest.Builder contextLines(int value)
AbstractDiffRequest.AbstractBuilder
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 AbstractDiffRequest.DEFAULT_CONTEXT_LINES
for clarity: contextLines(DiffRequest.DEFAULT_CONTEXT_LINES)
.
contextLines
in class AbstractDiffRequest.AbstractBuilder<DiffRequest.Builder,DiffRequest>
value
- the number of context lines to include around added and removed lines in the diff, which may
be AbstractDiffRequest.DEFAULT_CONTEXT_LINES
to use the default numberthis
@Nonnull public DiffRequest.Builder secondaryRepository(@Nullable Repository value)
value
- the secondary repository from which to generate the diffthis
@Nonnull public DiffRequest.Builder sinceId(@Nullable String value)
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.
value
- the "since" commit's ID, which will be trimmed to null
if blankthis
@Nonnull public DiffRequest.Builder path(@Nullable String value)
path
in class AbstractDiffRequest.AbstractBuilder<DiffRequest.Builder,DiffRequest>
@Nonnull public DiffRequest.Builder paths(@Nullable Iterable<String> values)
paths
in class AbstractDiffRequest.AbstractBuilder<DiffRequest.Builder,DiffRequest>
@Nonnull public DiffRequest.Builder paths(@Nullable String value, @Nullable String... values)
paths
in class AbstractDiffRequest.AbstractBuilder<DiffRequest.Builder,DiffRequest>
@Nonnull public DiffRequest.Builder whitespace(@Nonnull DiffWhitespace value)
whitespace
in class AbstractDiffRequest.AbstractBuilder<DiffRequest.Builder,DiffRequest>
@Nonnull public DiffRequest.Builder withComments(boolean value)
value
- true
if the comments should be included. false
otherwise.@Nonnull protected DiffRequest.Builder self()
self
in class AbstractDiffRequest.AbstractBuilder<DiffRequest.Builder,DiffRequest>
Copyright © 2022 Atlassian. All rights reserved.