Enum SerialisationFormat

    • Enum Constant Detail

      • 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 Detail

      • values

        public static SerialisationFormat[] 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 (SerialisationFormat c : SerialisationFormat.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SerialisationFormat valueOf​(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:
        IllegalArgumentException - if this enum type 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.