Class Http2Settings.Builder

java.lang.Object
io.github.mahmoudimus.http2.Http2Settings.Builder
Enclosing class:
Http2Settings

public static final class Http2Settings.Builder extends Object
Builds Http2Settings, starting from the protocol's initial values.
  • Method Details

    • headerTableSize

      public Http2Settings.Builder headerTableSize(long v)
      Sets the HPACK table limit.
      Parameters:
      v - the peer HPACK table limit in octets, from 0 to 2^32-1
      Returns:
      this builder
    • enablePush

      public Http2Settings.Builder enablePush(boolean v)
      Sets server push permission.
      Parameters:
      v - whether server push is permitted
      Returns:
      this builder
    • maxConcurrentStreams

      public Http2Settings.Builder maxConcurrentStreams(long v)
      Sets the concurrent stream limit.
      Parameters:
      v - the concurrent stream limit, or UNLIMITED
      Returns:
      this builder
    • initialWindowSize

      public Http2Settings.Builder initialWindowSize(int v)
      Sets the initial stream credit.
      Parameters:
      v - the initial stream credit in octets, from 0 to 2^31-1
      Returns:
      this builder
    • maxFrameSize

      public Http2Settings.Builder maxFrameSize(int v)
      Sets the maximum frame payload.
      Parameters:
      v - the maximum frame payload in octets, from 2^14 to 2^24-1
      Returns:
      this builder
    • maxHeaderListSize

      public Http2Settings.Builder maxHeaderListSize(long v)
      Sets the decoded field section limit.
      Parameters:
      v - the decoded field section limit in octets, or UNLIMITED
      Returns:
      this builder
    • enableConnectProtocol

      public Http2Settings.Builder enableConnectProtocol(boolean v)
      Sets extended CONNECT permission.
      Parameters:
      v - whether extended CONNECT is permitted
      Returns:
      this builder
    • build

      public Http2Settings build()
      Creates immutable settings, checking their protocol ranges.
      Returns:
      the configured settings
      Throws:
      IllegalArgumentException - if a configured value is outside its protocol range