Package com.atlassian.bitbucket.content
Class AbstractDiffRequest
java.lang.Object
com.atlassian.bitbucket.content.AbstractDiffRequest
- Direct Known Subclasses:
CompareDiffRequest
,DiffRequest
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Indicates the request should supply the default number of context lines for added and removed lines. -
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractDiffRequest
(AbstractDiffRequest.AbstractBuilder<?, ?> builder) -
Method Summary
Modifier and TypeMethodDescriptionint
Retrieves the numbers of context lines to show around added and removed lines.getPaths()
boolean
Retrieves a flag indicating whether an explicit number of context lines has been requested.
-
Field Details
-
DEFAULT_CONTEXT_LINES
public static final int DEFAULT_CONTEXT_LINESIndicates the request should supply the default number of context lines for added and removed lines. The default is configurable, so it may be changed by a system administrator. The shipped setting is 10 lines.- See Also:
-
-
Constructor Details
-
AbstractDiffRequest
-
-
Method Details
-
getContextLines
public int getContextLines()Retrieves the numbers of context lines to show around added and removed lines. If the value is0
context will be omitted and only added and removed lines will be shown. For positive values, that number of lines will be shown. For negative values, the system-configured default number will be shown.- Returns:
- the number of context lines that should be included around added and removed lines in the diff
-
getFilter
- Returns:
- an optional filter for this diff to filter out lines (and their surrounding file/hunk/segment)
-
getPaths
- Returns:
- specific paths to diff, which may be empty to stream the diff for every modified path
-
getWhitespace
- Returns:
- the whitespace settings used in the diff
-
hasContextLines
public boolean hasContextLines()Retrieves a flag indicating whether an explicit number of context lines has been requested. When this method returnstrue
,getContextLines()
will return a value greater than or equal to0
, When it returnsfalse
,getContextLines()
will returnDEFAULT_CONTEXT_LINES
.- Returns:
true
if a non-default
number of context lines has been requested; otherwise,false
to use the default number of lines
-