java.lang.Object
io.avaje.jex.compression.CompressionConfig
Configuration class for compression settings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallowsForCompression(String contentType) Determines if a given content type is allowed for compression.booleanChecks if compression is enabled.voidDisables compression.voidgzipCompressionLevel(int level) Sets the default GZIP compression level.intGets the minimum size for compression.minSizeForCompression(int minSizeForCompression) Sets the minimum size for compression and returns the updated configuration.
-
Constructor Details
-
CompressionConfig
public CompressionConfig()
-
-
Method Details
-
gzipCompressionLevel
public void gzipCompressionLevel(int level) Sets the default GZIP compression level.- Parameters:
level- The new compression level (0-9).
-
disableCompression
public void disableCompression()Disables compression. -
minSizeForCompression
public int minSizeForCompression()Gets the minimum size for compression.- Returns:
- The minimum size for compression.
-
minSizeForCompression
Sets the minimum size for compression and returns the updated configuration.- Parameters:
minSizeForCompression- The new minimum size for compression.- Returns:
- The updated configuration.
- Throws:
IllegalArgumentException- If the minimum size is less than a network packet size.
-
compressionEnabled
public boolean compressionEnabled()Checks if compression is enabled.- Returns:
- True if compression is enabled, false otherwise.
-
allowsForCompression
Determines if a given content type is allowed for compression.- Parameters:
contentType- The content type to check.- Returns:
- True if the content type is allowed for compression, false otherwise.
-