Enum 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
      BZIP2
      Constant used to identify the BZIP2 compression algorithm.
      GZIP
      Constant used to identify the GZIP compression algorithm.
      PACK200
      Constant used to identify the PACK200 compression algorithm.
      XZ
      Constant used to identify the XZ compression algorithm.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static CompressionType fromString​(java.lang.String compression)
      Attempts to return the CompressionType instance from a possible given string representation.
      java.lang.String getDefaultFileExtension()
      Returns the default file extension for this compression type.
      java.lang.String getName()
      Returns the name by which the compression algorithm is identified.
      static boolean isValidCompressionType​(java.lang.String compression)
      Checks if the given compression type name is valid and known format.
      static CompressionType valueOf​(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.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • 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 name
        java.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 the CompressionType instance 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.