Package com.github.fmjsjx.libnetty.http
Interface HttpContentCompressorProvider.Builder
- All Known Implementing Classes:
DefaultHttpContentCompressorProvider.Builder
- Enclosing interface:
- HttpContentCompressorProvider
public static interface HttpContentCompressorProvider.Builder
Interface to build
HttpContentCompressorProvider.-
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
-
build
HttpContentCompressorProvider build()Creates a newHttpContentCompressorProviderwith the current settings.- Returns:
- a
HttpContentCompressorProvider
-
contentSizeThreshold
Set 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.- Parameters:
contentSizeThreshold- the content size threshold- Returns:
- this builder
-
gzip
Enable gzip with default options.- Returns:
- this builder
-
gzip
Enable gzip with given options.- Parameters:
options-GzipOptions- Returns:
- this builder
-
disableGzip
HttpContentCompressorProvider.Builder disableGzip()Disable gzip.- Returns:
- this builder
-
deflate
HttpContentCompressorProvider.Builder deflate()Enable deflate with default options.- Returns:
- this builder
-
deflate
HttpContentCompressorProvider.Builder deflate(io.netty.handler.codec.compression.DeflateOptions options) Enable deflate with given options.- Parameters:
options-DeflateOptions- Returns:
- this builder
-
disableDeflate
HttpContentCompressorProvider.Builder disableDeflate()Disable deflate.- Returns:
- this builder
-
brotli
Enable brotli with default options.- Returns:
- this builder
-
brotli
HttpContentCompressorProvider.Builder brotli(io.netty.handler.codec.compression.BrotliOptions options) Enable brotli with given options.- Parameters:
options-BrotliOptions- Returns:
- this builder
-
disableBrotli
HttpContentCompressorProvider.Builder disableBrotli()Disable brotli.- Returns:
- this builder
-
zstd
Enable zstd with default options.- Returns:
- this builder
-
zstd
Enable brotli with given options.- Parameters:
options-ZstdOptions- Returns:
- this builder
-
disableZstd
HttpContentCompressorProvider.Builder disableZstd()Disable brotli.- Returns:
- this builder
-