Enum Class NoSQLType

java.lang.Object
java.lang.Enum<NoSQLType>
jakarta.nosql.tck.NoSQLType
All Implemented Interfaces:
Serializable, Comparable<NoSQLType>, Constable

public enum NoSQLType extends Enum<NoSQLType>
Enum representing various types of NoSQL databases supported by Jakarta NoSQL. Each type is associated with a flexibility level, which indicates the database's capability to perform queries beyond basic operations. Flexibility Level: The flexibility level reflects the ability of a NoSQL database type to retrieve and query information beyond the key itself:
  • KEY_VALUE (1): Key-value stores generally support queries using only the key, resulting in lower flexibility.
  • COLUMN (2): Column-family databases offer more advanced querying capabilities, such as filtering rows based on column values, providing moderate flexibility.
  • DOCUMENT (3): Document-based databases support rich querying capabilities over nested structures and fields within documents, leading to higher flexibility.
  • GRAPH (4): Graph databases excel in querying relationships, relationship directions, and properties, making them the most flexible type among NoSQL databases.
  • OTHER (0): Represents database types that do not fit into the other categories or have unknown flexibility.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Column-family databases organize data into rows and columns and allow advanced filtering and operations at the column level.
    Document-based databases store data in structured documents.
    Graph databases specialize in querying relationships and properties between entities.
    Key-value stores are databases optimized for simple key-based lookups.
    Represents database types that do not fall into the predefined categories or have an unknown level of flexibility.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The system property used to define the NoSQL database type.
    static final String
    The default database type, used when no type is explicitly specified.
  • Method Summary

    Modifier and Type
    Method
    Description
    static NoSQLType
    get()
    Retrieves the NoSQLType from the system property DATABASE_TYPE_PROPERTY.
    static NoSQLType
    get(String type)
    Retrieves the NoSQLType based on the given type name.
    int
    Returns the flexibility level of the current database type.
    static NoSQLType
    Returns the enum constant of this class with the specified name.
    static NoSQLType[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • KEY_VALUE

      public static final NoSQLType KEY_VALUE
      Key-value stores are databases optimized for simple key-based lookups. These databases have limited flexibility because they typically cannot perform advanced queries beyond retrieving values by keys.
    • COLUMN

      public static final NoSQLType COLUMN
      Column-family databases organize data into rows and columns and allow advanced filtering and operations at the column level. These databases offer moderate flexibility due to their ability to query based on column values.
    • DOCUMENT

      public static final NoSQLType DOCUMENT
      Document-based databases store data in structured documents. These databases enable rich queries over nested structures and fields, providing a high degree of flexibility for complex queries.
    • GRAPH

      public static final NoSQLType GRAPH
      Graph databases specialize in querying relationships and properties between entities. These databases offer the highest flexibility due to their ability to perform complex queries on nodes, edges, relationships, directions, and properties.
    • OTHER

      public static final NoSQLType OTHER
      Represents database types that do not fall into the predefined categories or have an unknown level of flexibility. This category is used for custom or less common database types.
  • Field Details

    • DATABASE_TYPE_PROPERTY

      public static final String DATABASE_TYPE_PROPERTY
      The system property used to define the NoSQL database type.
      See Also:
    • DEFAULT_DATABASE_TYPE

      public static final String DEFAULT_DATABASE_TYPE
      The default database type, used when no type is explicitly specified.
      See Also:
  • Method Details

    • values

      public static NoSQLType[] 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 NoSQLType 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
    • getFlexibility

      public int getFlexibility()
      Returns the flexibility level of the current database type. The flexibility score is determined based on the type's capability to perform queries beyond simple key-based lookups. For example:
      • Key-value stores typically only allow key-based lookups, resulting in a lower flexibility score.
      • Graph databases enable complex queries involving relationships, directions, and properties, resulting in the highest flexibility score.
      Returns:
      the flexibility level
    • get

      public static NoSQLType get()
      Retrieves the NoSQLType from the system property DATABASE_TYPE_PROPERTY. If the property is not set, the DEFAULT_DATABASE_TYPE is used.
      Returns:
      the NoSQLType corresponding to the system property or default type
    • get

      public static NoSQLType get(String type)
      Retrieves the NoSQLType based on the given type name. If the type name is invalid, the DEFAULT_DATABASE_TYPE is used.
      Parameters:
      type - the name of the NoSQL type
      Returns:
      the corresponding NoSQLType, or the default type if invalid