Enum Class CompressionFormat
- All Implemented Interfaces:
Serializable, Comparable<CompressionFormat>, Constable
Represents a compression format we can read from or write to.
For now we only support GZip (and so this enumeration is kind of pointless), but we may expand that to other formats (e.g. BZip2, XZ) in the future.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic CompressionFormatfromFilename(String name) Infers a compression format from a filename.static CompressionFormatGets a compression format by its name.Gets the typical filename extension associated with the format.static CompressionFormatReturns the enum constant of this class with the specified name.static CompressionFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No compression. -
GZIP
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getExtension
Gets the typical filename extension associated with the format.- Returns:
- The format filename extension.
-
fromName
Gets a compression format by its name.- Parameters:
name- The name of the format.- Returns:
- The compression format;
NONEif the given name does not match any known format.
-
fromFilename
Infers a compression format from a filename.- Parameters:
name- The filename to infer the compression format from.- Returns:
- The inferred compression format;
NONEif no compression format could be recognised.
-