Enum Class ScalarKind

java.lang.Object
java.lang.Enum<ScalarKind>
dev.omnist.schema.ScalarKind
All Implemented Interfaces:
Serializable, Comparable<ScalarKind>, Constable

public enum ScalarKind extends Enum<ScalarKind>
The seven scalar type keywords a field can name in OSD (omnist-spec §5, §3.3). Each variant's keyword() is the exact bareword that appears in schema text, e.g. field "x": string.
  • Enum Constant Details

    • STRING

      public static final ScalarKind STRING
      OSD keyword string.
    • INTEGER

      public static final ScalarKind INTEGER
      OSD keyword integer.
    • NUMBER

      public static final ScalarKind NUMBER
      OSD keyword number.
    • BOOLEAN

      public static final ScalarKind BOOLEAN
      OSD keyword boolean.
    • DATE

      public static final ScalarKind DATE
      OSD keyword date.
    • TIME

      public static final ScalarKind TIME
      OSD keyword time.
    • DATETIME

      public static final ScalarKind DATETIME
      OSD keyword datetime.
  • Method Details

    • values

      public static ScalarKind[] 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 ScalarKind 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
    • keyword

      public String keyword()
      Returns the exact bareword this kind is spelled as in OSD schema text.
    • fromKeyword

      public static ScalarKind fromKeyword(String name)
      Resolves an OSD bareword back to its ScalarKind.
      Parameters:
      name - the bareword as it appears in schema text (e.g. "integer")
      Returns:
      the matching kind, or null if name does not match any keyword