public enum ContentCoding extends Enum<ContentCoding>
Each constant corresponds to the standard token used in the Content-Encoding
and Accept-Encoding headers. Some codings (e.g. Brotli, Zstandard, XZ/LZMA)
may require additional helper libraries at runtime.
| Enum Constant and Description |
|---|
BROTLI
Brotli compression format.
|
BZIP2
BZIP2 compression format.
|
DEFLATE
"deflate" compression format (zlib or raw).
|
DEFLATE64
Deflate64 compression format.
|
GZIP
GZIP compression format.
|
LZ4_BLOCK
Block LZ4 compression format.
|
LZ4_FRAMED
Framed LZ4 compression format.
|
LZMA
LZMA compression format.
|
PACK200
Pack200 compression format.
|
X_GZIP
Legacy alias for GZIP.
|
XZ
XZ compression format.
|
ZSTD
Zstandard compression format.
|
| Modifier and Type | Method and Description |
|---|---|
static ContentCoding |
fromToken(String token)
Lookup an enum by its token (case‐insensitive), or
null if none matches. |
String |
token()
Returns the standard IANA token string for this content-coding.
|
static ContentCoding |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ContentCoding[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ContentCoding GZIP
public static final ContentCoding DEFLATE
public static final ContentCoding X_GZIP
public static final ContentCoding BROTLI
public static final ContentCoding ZSTD
public static final ContentCoding XZ
public static final ContentCoding LZMA
public static final ContentCoding LZ4_FRAMED
public static final ContentCoding LZ4_BLOCK
public static final ContentCoding BZIP2
public static final ContentCoding PACK200
public static final ContentCoding DEFLATE64
public static ContentCoding[] values()
for (ContentCoding c : ContentCoding.values()) System.out.println(c);
public static ContentCoding valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String token()
public static ContentCoding fromToken(String token)
null if none matches.
This method is backed by a static, pre‐populated map so the lookup is O(1) instead of O(n).
token - the content‐coding token to look upnull if noneCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.