Enum Class ConcreteSyntax

java.lang.Object
java.lang.Enum<ConcreteSyntax>
dev.roanh.gmark.output.ConcreteSyntax
All Implemented Interfaces:
Serializable, Comparable<ConcreteSyntax>, Constable

public enum ConcreteSyntax extends Enum<ConcreteSyntax>
Enum defining concrete output syntaxes for generated queries.
  • Enum Constant Details

  • Field Details

    • id

      private final String id
      The ID of this concrete syntax as used for command line arguments and output folder creation.
    • extension

      private final String extension
      The file extension of files created for this syntax.
    • convert

      private final Function<Query,String> convert
      Function to convert a query to this concrete syntax.
  • Constructor Details

    • ConcreteSyntax

      private ConcreteSyntax(String id, String extension, Function<Query,String> convert)
      Constructs a new concrete syntax with the given ID, file extension and query conversion function.
      Parameters:
      id - The ID of this concrete syntax.
      extension - The file extension for this syntax.
      convert - The function to convert queries to this syntax.
  • Method Details

    • values

      public static ConcreteSyntax[] 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 ConcreteSyntax 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 display name of this syntax.
      Returns:
      The display name of this syntax.
    • getID

      public String getID()
      The ID of this syntax as used for command line arguments and file output.
      Returns:
      The ID of this syntax.
    • getExtension

      public String getExtension()
      Gets the file extension for output files created for this concrete syntax.
      Returns:
      The file extension.
    • convert

      public String convert(Query query)
      Converts the given query to this syntax.
      Parameters:
      query - The query to convert.
      Returns:
      The query represented in this concrete syntax.
    • fromName

      public static ConcreteSyntax fromName(String id)
      Resolves a concrete syntax by its identifier name.
      Parameters:
      id - The ID of the syntax to resolve.
      Returns:
      The resolved syntax or null if no syntax with the given ID was found.