Enum Class CompressionFormat

java.lang.Object
java.lang.Enum<CompressionFormat>
org.incenp.obofoundry.sssom.util.CompressionFormat
All Implemented Interfaces:
Serializable, Comparable<CompressionFormat>, Constable

public enum CompressionFormat extends Enum<CompressionFormat>
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.

  • Enum Constant Details

  • Method Details

    • values

      public static CompressionFormat[] 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

      public static CompressionFormat valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getExtension

      public String getExtension()
      Gets the typical filename extension associated with the format.
      Returns:
      The format filename extension.
    • fromName

      public static CompressionFormat fromName(String name)
      Gets a compression format by its name.
      Parameters:
      name - The name of the format.
      Returns:
      The compression format; NONE if the given name does not match any known format.
    • fromFilename

      public static CompressionFormat fromFilename(String name)
      Infers a compression format from a filename.
      Parameters:
      name - The filename to infer the compression format from.
      Returns:
      The inferred compression format; NONE if no compression format could be recognised.