Class FetchV2Request.Builder

    • 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
      • doneReceived

        boolean doneReceived
      • waitForDone

        boolean waitForDone
      • serverOptions

        final java.util.List<java.lang.String> serverOptions
      • sidebandAll

        boolean sidebandAll
      • packfileUriProtocols

        final java.util.List<java.lang.String> packfileUriProtocols
    • Constructor Detail

      • Builder

        private Builder()
    • 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
      • 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.
      • setDoneReceived

        FetchV2Request.Builder setDoneReceived()
        Mark that the "done" line has been received.
        Returns:
        this builder
      • setWaitForDone

        FetchV2Request.Builder setWaitForDone()
        Mark that the "wait-for-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 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