Package org.eclipse.jgit.transport
Class FetchV2Request.Builder
- java.lang.Object
-
- org.eclipse.jgit.transport.FetchV2Request.Builder
-
- Enclosing class:
- FetchV2Request
static final class FetchV2Request.Builder extends java.lang.Object
A builder forFetchV2Request
.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.String
agent
(package private) java.util.Set<java.lang.String>
clientCapabilities
(package private) java.util.Set<ObjectId>
clientShallowCommits
(package private) java.util.List<java.lang.String>
deepenNotRefs
(package private) int
deepenSince
(package private) int
depth
(package private) boolean
doneReceived
(package private) FilterSpec
filterSpec
(package private) java.util.List<java.lang.String>
packfileUriProtocols
(package private) java.util.List<ObjectId>
peerHas
(package private) java.util.List<java.lang.String>
serverOptions
(package private) boolean
sidebandAll
(package private) java.util.List<java.lang.String>
wantedRefs
(package private) java.util.Set<ObjectId>
wantIds
-
Constructor Summary
Constructors Modifier Constructor Description private
Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) FetchV2Request.Builder
addClientCapability(java.lang.String clientCapability)
(package private) FetchV2Request.Builder
addClientShallowCommit(ObjectId shallowOid)
(package private) FetchV2Request.Builder
addDeepenNotRef(java.lang.String deepenNotRef)
(package private) FetchV2Request.Builder
addPackfileUriProtocol(java.lang.String value)
(package private) FetchV2Request.Builder
addPeerHas(ObjectId objectId)
(package private) FetchV2Request.Builder
addServerOption(java.lang.String value)
Records an application-specific option supplied in a server-option line, for later retrieval withFetchV2Request.getServerOptions()
.(package private) FetchV2Request.Builder
addWantedRef(java.lang.String refName)
Ref received in "want-ref" line and the object-id it refers to(package private) FetchV2Request.Builder
addWantId(ObjectId wantId)
(package private) FetchV2Request
build()
(package private) int
getDeepenSince()
(package private) int
getDepth()
(package private) boolean
hasDeepenNotRefs()
(package private) FetchV2Request.Builder
setAgent(java.lang.String agentValue)
Value of an agent line received after the command and before the arguments.(package private) FetchV2Request.Builder
setDeepenSince(int value)
(package private) FetchV2Request.Builder
setDepth(int d)
(package private) FetchV2Request.Builder
setDoneReceived()
Mark that the "done" line has been received.(package private) FetchV2Request.Builder
setFilterSpec(FilterSpec filter)
(package private) FetchV2Request.Builder
setSidebandAll(boolean value)
-
-
-
Field Detail
-
peerHas
final java.util.List<ObjectId> peerHas
-
wantedRefs
final java.util.List<java.lang.String> wantedRefs
-
wantIds
final java.util.Set<ObjectId> wantIds
-
clientShallowCommits
final java.util.Set<ObjectId> clientShallowCommits
-
deepenNotRefs
final java.util.List<java.lang.String> deepenNotRefs
-
clientCapabilities
final java.util.Set<java.lang.String> clientCapabilities
-
depth
int depth
-
deepenSince
int deepenSince
-
filterSpec
FilterSpec filterSpec
-
doneReceived
boolean doneReceived
-
agent
@Nullable java.lang.String agent
-
serverOptions
final java.util.List<java.lang.String> serverOptions
-
sidebandAll
boolean sidebandAll
-
packfileUriProtocols
final java.util.List<java.lang.String> packfileUriProtocols
-
-
Method Detail
-
addPeerHas
FetchV2Request.Builder addPeerHas(ObjectId objectId)
- Parameters:
objectId
- object id received in a "have" line- Returns:
- this builder
-
addWantedRef
FetchV2Request.Builder addWantedRef(java.lang.String refName)
Ref received in "want-ref" line and the object-id it refers to- Parameters:
refName
- reference name- Returns:
- this builder
-
addClientCapability
FetchV2Request.Builder addClientCapability(java.lang.String clientCapability)
- Parameters:
clientCapability
- capability line sent by the client- Returns:
- this builder
-
addWantId
FetchV2Request.Builder addWantId(ObjectId wantId)
- Parameters:
wantId
- object id received in a "want" line- Returns:
- this builder
-
addClientShallowCommit
FetchV2Request.Builder addClientShallowCommit(ObjectId shallowOid)
- Parameters:
shallowOid
- object id received in a "shallow" line- Returns:
- this builder
-
setDepth
FetchV2Request.Builder setDepth(int d)
- Parameters:
d
- Depth received in a "deepen" line- Returns:
- this builder
-
getDepth
int getDepth()
- Returns:
- depth set in the request (via a "deepen" line). Defaulting to 0 if not set.
-
hasDeepenNotRefs
boolean hasDeepenNotRefs()
- Returns:
- true if there has been at least one "deepen not" line in the request so far
-
addDeepenNotRef
FetchV2Request.Builder addDeepenNotRef(java.lang.String deepenNotRef)
- Parameters:
deepenNotRef
- reference received in a "deepen not" line- Returns:
- this builder
-
setDeepenSince
FetchV2Request.Builder setDeepenSince(int value)
- Parameters:
value
- Unix timestamp received in a "deepen since" line- Returns:
- this builder
-
getDeepenSince
int getDeepenSince()
- Returns:
- shallow since value, sent before in a "deepen since" line. 0 by default.
-
setFilterSpec
FetchV2Request.Builder setFilterSpec(@NonNull FilterSpec filter)
- Parameters:
filter
- spec set in a "filter" line- Returns:
- this builder
-
setDoneReceived
FetchV2Request.Builder setDoneReceived()
Mark that the "done" line has been received.- Returns:
- this builder
-
setAgent
FetchV2Request.Builder setAgent(@Nullable java.lang.String agentValue)
Value of an agent line received after the command and before the arguments. E.g. "agent=a.b.c/1.0" should set "a.b.c/1.0".- Parameters:
agentValue
- the client-supplied agent capability, without the leading "agent="- Returns:
- this builder
-
addServerOption
FetchV2Request.Builder addServerOption(@NonNull java.lang.String value)
Records an application-specific option supplied in a server-option line, for later retrieval withFetchV2Request.getServerOptions()
.- Parameters:
value
- the client-supplied server-option capability, without leading "server-option=".- Returns:
- this builder
-
setSidebandAll
FetchV2Request.Builder setSidebandAll(boolean value)
- Parameters:
value
- true if client sent "sideband-all"- Returns:
- this builder
-
addPackfileUriProtocol
FetchV2Request.Builder addPackfileUriProtocol(@NonNull java.lang.String value)
-
build
FetchV2Request build()
- Returns:
- Initialized fetch request
-
-