Enum Class SerialisationFormat

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

public enum SerialisationFormat extends Enum<SerialisationFormat>
Represents a format able to serialise SSSOM data.
  • Enum Constant Details

    • TSV

      public static final SerialisationFormat TSV
      SSSOM/TSV, the main format specifically designed to serialise SSSOM mappings.
    • CSV

      public static final SerialisationFormat CSV
      SSSOM/CSV, variant used comma-separated columns.
    • JSON

      public static final SerialisationFormat JSON
      SSSOM/JSON, the other format described in the SSSOM specification.
    • RDF_TURTLE

      public static final SerialisationFormat RDF_TURTLE
      RDF/Turtle, a RDF representation of SSSOM objects in the Turtle syntax.
  • Method Details

    • values

      public static SerialisationFormat[] 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 SerialisationFormat 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
    • getName

      public String getName()
      Gets the user-facing name of the serialisation format.

      That name is suitable, e.g. for display in graphical interfaces.

      Returns:
      The format name.
    • getSortName

      public String getSortName()
      Gets the short name of the serialisation format.

      That name is suitable, e.g. for selecting the format in a command-line option.

      Returns:
      The format short name.
    • getExtension

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

      public static List<String> getShortNames()
      Gets a list of all available format short names.
      Returns:
      The available formats, as a list of short names.
    • fromName

      public static SerialisationFormat fromName(String name)
      Gets a serialisation format by its name (long or short).
      Parameters:
      name - The name of the format. It can be either the user-facing name (as returned by getName()) or the short name (as returned by getShortNames()).
      Returns:
      The serialisation format, or null if the given name does not match any known format.
    • fromExtension

      public static SerialisationFormat fromExtension(String extension)
      Gets a serialisation format by its associated filename extension.
      Parameters:
      extension - The filename extension (not including the initial dot).
      Returns:
      The serialisation format, or null if the given extension does not match any extension associated with a known format.