Package org.rauschig.jarchivelib
Enum CompressionType
- java.lang.Object
-
- java.lang.Enum<CompressionType>
-
- org.rauschig.jarchivelib.CompressionType
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<CompressionType>
public enum CompressionType extends java.lang.Enum<CompressionType>
Denotes a compression algorithm such as gzip or bzip2
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BZIP2Constant used to identify the BZIP2 compression algorithm.GZIPConstant used to identify the GZIP compression algorithm.PACK200Constant used to identify the PACK200 compression algorithm.XZConstant used to identify the XZ compression algorithm.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CompressionTypefromString(java.lang.String compression)Attempts to return theCompressionTypeinstance from a possible given string representation.java.lang.StringgetDefaultFileExtension()Returns the default file extension for this compression type.java.lang.StringgetName()Returns the name by which the compression algorithm is identified.static booleanisValidCompressionType(java.lang.String compression)Checks if the given compression type name is valid and known format.static CompressionTypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static CompressionType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BZIP2
public static final CompressionType BZIP2
Constant used to identify the BZIP2 compression algorithm.
-
GZIP
public static final CompressionType GZIP
Constant used to identify the GZIP compression algorithm.
-
XZ
public static final CompressionType XZ
Constant used to identify the XZ compression algorithm.
-
PACK200
public static final CompressionType PACK200
Constant used to identify the PACK200 compression algorithm.
-
-
Method Detail
-
values
public static CompressionType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CompressionType c : CompressionType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CompressionType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getName
public java.lang.String getName()
Returns the name by which the compression algorithm is identified.- Returns:
- the compression algorithm name
-
getDefaultFileExtension
public java.lang.String getDefaultFileExtension()
Returns the default file extension for this compression type. E.g. ".gz" for gzip.- Returns:
- the default file extension preceded by a dot
-
isValidCompressionType
public static boolean isValidCompressionType(java.lang.String compression)
Checks if the given compression type name is valid and known format.- Parameters:
compression- the compression algorithm name- Returns:
- true true if the given compression type is known to the factory, false otherwise
-
fromString
public static CompressionType fromString(java.lang.String compression)
Attempts to return theCompressionTypeinstance from a possible given string representation. Ignores case.- Parameters:
compression- string representation of the compression type. E.g. "GZIP".- Returns:
- the compression type enum
- Throws:
java.lang.IllegalArgumentException- if the given compression type is unknown.
-
-