Enum StorageMethod

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<StorageMethod>

    public enum StorageMethod
    extends java.lang.Enum<StorageMethod>
    Available storage methods for the plugin
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      H2
      H2 storage method
      JSON
      JSON storage method
      MARIADB
      MariaDB storage method
      MYSQL
      MySQL storage method
      POSTGRESQL
      PostgreSQL storage method
      SQLITE
      SQLite storage method
      YAML
      YAML storage method
    • Field Summary

      Fields 
      Modifier and Type Field Description
      @Nullable java.lang.Integer defaultPort
      The default port for the method (only for remote connections)
      @NotNull StorageMethod.DialectFunction dialect
      The Dialect constructor for the method
      @Nullable RuntimeLibrary library
      The RuntimeLibrary to download/load if the method requires one
      @Nullable java.util.function.Function<java.io.File,​java.lang.String> url
      Local SQL: The full URL for the method
      Remote SQL: The beginning of the URL for the method
      Local Readable: null
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static @NotNull StorageMethod get​(@Nullable java.lang.String name)
      Get the StorageMethod with the given name
      @NotNull java.util.Optional<java.lang.String> getDriver()
      Get the driver class name for the method
      boolean isRemote()
      Whether the method is remote (just checks if defaultPort is not null)
      boolean isSQL()
      Whether the method is SQL (just checks if driver is not null)
      static StorageMethod valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static StorageMethod[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

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

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

      • url

        @Nullable
        public final @Nullable java.util.function.Function<java.io.File,​java.lang.String> url
        Local SQL: The full URL for the method
        Remote SQL: The beginning of the URL for the method
        Local Readable: null
      • defaultPort

        @Nullable
        public final @Nullable java.lang.Integer defaultPort
        The default port for the method (only for remote connections)
    • Method Detail

      • values

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

        public static StorageMethod valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getDriver

        @NotNull
        public @NotNull java.util.Optional<java.lang.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 java.lang.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