Package io.muserver
Class Http2ConfigBuilder
- java.lang.Object
-
- io.muserver.Http2ConfigBuilder
-
public class Http2ConfigBuilder extends java.lang.Object
Configuration builder for enabling HTTP2 by passing the config toMuServerBuilder.withHttp2Config(Http2ConfigBuilder)
-
-
Constructor Summary
Constructors Constructor Description Http2ConfigBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Http2Config
build()
Creates the HTTP2 settings objectboolean
enabled()
Http2ConfigBuilder
enabled(boolean enabled)
Specifies whether to enable HTTP2 or not.static Http2ConfigBuilder
http2Config()
Creates a new config where HTTP2 is disabledstatic Http2ConfigBuilder
http2Enabled()
Creates a new config where HTTP2 is enabledstatic Http2ConfigBuilder
http2EnabledIfAvailable()
Creates a new config where HTTP2 is enabled if supported by the Java version.
-
-
-
Method Detail
-
enabled
public Http2ConfigBuilder enabled(boolean enabled)
Specifies whether to enable HTTP2 or not.- Parameters:
enabled
-true
to enable;false
to disable.- Returns:
- This builder
-
enabled
public boolean enabled()
- Returns:
- The current value of this property
-
build
public Http2Config build()
Creates the HTTP2 settings object- Returns:
- A new Http2Config object
-
http2Config
public static Http2ConfigBuilder http2Config()
Creates a new config where HTTP2 is disabled- Returns:
- A new builder
-
http2Enabled
public static Http2ConfigBuilder http2Enabled()
Creates a new config where HTTP2 is enabled- Returns:
- A new builder
-
http2EnabledIfAvailable
public static Http2ConfigBuilder http2EnabledIfAvailable()
Creates a new config where HTTP2 is enabled if supported by the Java version.
The current logic may not always return the correct results. It does not actually test for availability and instead tries to detect the Java version, and enables HTTP2 for Java 9 or later.
- Returns:
- A new builder
-
-