Package com.github.fmjsjx.libnetty.http
Class DefaultHttpContentCompressorProvider.Builder
java.lang.Object
com.github.fmjsjx.libnetty.http.DefaultHttpContentCompressorProvider.Builder
- All Implemented Interfaces:
HttpContentCompressorProvider.Builder
- Enclosing class:
- DefaultHttpContentCompressorProvider
public static final class DefaultHttpContentCompressorProvider.Builder
extends Object
implements HttpContentCompressorProvider.Builder
A builder to build
HttpContentCompressorProviders.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbrotli()Enable brotli with default options.brotli(io.netty.handler.codec.compression.BrotliOptions options) Enable brotli with given options.build()Creates a newHttpContentCompressorProviderwith the current settings.contentSizeThreshold(int contentSizeThreshold) Set the content size threshold.deflate()Enable deflate with default options.deflate(io.netty.handler.codec.compression.DeflateOptions options) Enable deflate with given options.Disable brotli.Disable deflate.Disable gzip.Disable brotli.gzip()Enable gzip with default options.gzip(io.netty.handler.codec.compression.GzipOptions options) Enable gzip with given options.zstd()Enable zstd with default options.zstd(io.netty.handler.codec.compression.ZstdOptions options) Enable brotli with given options.
-
Method Details
-
contentSizeThreshold
Description copied from interface:HttpContentCompressorProvider.BuilderSet the content size threshold. The response body is compressed when the size of the response body exceeds the threshold. The value should be a non-negative number.0will enable compression for all responses. The default value is1024.- Specified by:
contentSizeThresholdin interfaceHttpContentCompressorProvider.Builder- Parameters:
contentSizeThreshold- the content size threshold- Returns:
- this builder
-
build
Description copied from interface:HttpContentCompressorProvider.BuilderCreates a newHttpContentCompressorProviderwith the current settings.- Specified by:
buildin interfaceHttpContentCompressorProvider.Builder- Returns:
- a
HttpContentCompressorProvider
-
gzip
Description copied from interface:HttpContentCompressorProvider.BuilderEnable gzip with default options.- Specified by:
gzipin interfaceHttpContentCompressorProvider.Builder- Returns:
- this builder
-
gzip
public DefaultHttpContentCompressorProvider.Builder gzip(io.netty.handler.codec.compression.GzipOptions options) Description copied from interface:HttpContentCompressorProvider.BuilderEnable gzip with given options.- Specified by:
gzipin interfaceHttpContentCompressorProvider.Builder- Parameters:
options-GzipOptions- Returns:
- this builder
-
disableGzip
Description copied from interface:HttpContentCompressorProvider.BuilderDisable gzip.- Specified by:
disableGzipin interfaceHttpContentCompressorProvider.Builder- Returns:
- this builder
-
deflate
Description copied from interface:HttpContentCompressorProvider.BuilderEnable deflate with default options.- Specified by:
deflatein interfaceHttpContentCompressorProvider.Builder- Returns:
- this builder
-
deflate
public DefaultHttpContentCompressorProvider.Builder deflate(io.netty.handler.codec.compression.DeflateOptions options) Description copied from interface:HttpContentCompressorProvider.BuilderEnable deflate with given options.- Specified by:
deflatein interfaceHttpContentCompressorProvider.Builder- Parameters:
options-DeflateOptions- Returns:
- this builder
-
disableDeflate
Description copied from interface:HttpContentCompressorProvider.BuilderDisable deflate.- Specified by:
disableDeflatein interfaceHttpContentCompressorProvider.Builder- Returns:
- this builder
-
brotli
Description copied from interface:HttpContentCompressorProvider.BuilderEnable brotli with default options.- Specified by:
brotliin interfaceHttpContentCompressorProvider.Builder- Returns:
- this builder
-
brotli
public DefaultHttpContentCompressorProvider.Builder brotli(io.netty.handler.codec.compression.BrotliOptions options) Description copied from interface:HttpContentCompressorProvider.BuilderEnable brotli with given options.- Specified by:
brotliin interfaceHttpContentCompressorProvider.Builder- Parameters:
options-BrotliOptions- Returns:
- this builder
-
disableBrotli
Description copied from interface:HttpContentCompressorProvider.BuilderDisable brotli.- Specified by:
disableBrotliin interfaceHttpContentCompressorProvider.Builder- Returns:
- this builder
-
zstd
Description copied from interface:HttpContentCompressorProvider.BuilderEnable zstd with default options.- Specified by:
zstdin interfaceHttpContentCompressorProvider.Builder- Returns:
- this builder
-
zstd
public DefaultHttpContentCompressorProvider.Builder zstd(io.netty.handler.codec.compression.ZstdOptions options) Description copied from interface:HttpContentCompressorProvider.BuilderEnable brotli with given options.- Specified by:
zstdin interfaceHttpContentCompressorProvider.Builder- Parameters:
options-ZstdOptions- Returns:
- this builder
-
disableZstd
Description copied from interface:HttpContentCompressorProvider.BuilderDisable brotli.- Specified by:
disableZstdin interfaceHttpContentCompressorProvider.Builder- Returns:
- this builder
-