Class FetchV2Request.Builder

java.lang.Object
org.eclipse.jgit.transport.FetchV2Request.Builder
Enclosing class:
FetchV2Request

static final class FetchV2Request.Builder extends Object
A builder for FetchV2Request.
  • Field Details

    • peerHas

      final List<ObjectId> peerHas
    • wantedRefs

      final List<String> wantedRefs
    • wantIds

      final Set<ObjectId> wantIds
    • clientShallowCommits

      final Set<ObjectId> clientShallowCommits
    • deepenNotRefs

      final List<String> deepenNotRefs
    • clientCapabilities

      final Set<String> clientCapabilities
    • depth

      int depth
    • deepenSince

      int deepenSince
    • filterSpec

      FilterSpec filterSpec
    • doneReceived

      boolean doneReceived
    • agent

    • serverOptions

      final List<String> serverOptions
    • sidebandAll

      boolean sidebandAll
    • packfileUriProtocols

      final List<String> packfileUriProtocols
  • Constructor Details

    • Builder

      private Builder()
  • Method Details

    • addPeerHas

      FetchV2Request.Builder addPeerHas(ObjectId objectId)
      Parameters:
      objectId - object id received in a "have" line
      Returns:
      this builder
    • addWantedRef

      FetchV2Request.Builder addWantedRef(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(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(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

      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 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 String value)
      Records an application-specific option supplied in a server-option line, for later retrieval with FetchV2Request.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 String value)
    • build

      Returns:
      Initialized fetch request