Enum Class StorageMethod

java.lang.Object
java.lang.Enum<StorageMethod>
xyz.srnyx.annoyingapi.storage.StorageMethod
All Implemented Interfaces:
Serializable, Comparable<StorageMethod>, Constable

public enum StorageMethod extends Enum<StorageMethod>
Available storage methods for the plugin
  • Enum Constant Details

    • H2

      public static final StorageMethod H2
      H2 storage method
    • SQLITE

      public static final StorageMethod SQLITE
      SQLite storage method
    • MYSQL

      public static final StorageMethod MYSQL
      MySQL storage method
    • MARIADB

      public static final StorageMethod MARIADB
      MariaDB storage method
    • POSTGRESQL

      public static final StorageMethod POSTGRESQL
      PostgreSQL storage method
    • JSON

      public static final StorageMethod JSON
      JSON storage method
    • YAML

      public static final StorageMethod YAML
      YAML storage method
  • Field Details

    • dialect

      @NotNull public final @NotNull StorageMethod.DialectFunction dialect
      The Dialect constructor for the method
    • url

      @Nullable public final @Nullable Function<Path,String> url
      Local SQL: The full URL for the method
      Remote SQL: The beginning of the URL for the method
      Local Readable: null
    • library

      @Nullable public final @Nullable RuntimeLibrary library
      The RuntimeLibrary to download/load if the method requires one
    • defaultPort

      @Nullable public final @Nullable Integer defaultPort
      The default port for the method (only for remote connections)
  • Method Details

    • values

      public static StorageMethod[] 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 StorageMethod 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
    • getDriver

      @NotNull public @NotNull Optional<String> getDriver()
      Get the driver class name for the method
      Returns:
      the driver class name for the method
    • isRemote

      public boolean isRemote()
      Whether the method is remote (just checks if defaultPort is not null)
      Returns:
      true if the method is remote, false otherwise
    • isSQL

      public boolean isSQL()
      Whether the method is SQL (just checks if driver is not null)
      Returns:
      true if the method is SQL, false otherwise
    • get

      @NotNull public static @NotNull StorageMethod get(@Nullable @Nullable String name)
      Get the StorageMethod with the given name
      Parameters:
      name - the name of the method
      Returns:
      the StorageMethod with the given name, or H2 if the name is null or invalid