Package xyz.srnyx.annoyingapi.storage
Enum StorageMethod
- java.lang.Object
-
- java.lang.Enum<StorageMethod>
-
- xyz.srnyx.annoyingapi.storage.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceStorageMethod.DialectFunctionA function to create a newDialect
-
Field Summary
Fields Modifier and Type Field Description @Nullable java.lang.IntegerdefaultPortThe default port for the method (only for remote connections)@NotNull StorageMethod.DialectFunctiondialectTheDialectconstructor for the method@Nullable RuntimeLibrarylibraryTheRuntimeLibraryto download/load if the method requires one@Nullable java.util.function.Function<java.io.File,java.lang.String>urlLocal 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 StorageMethodget(@Nullable java.lang.String name)Get theStorageMethodwith the given name@NotNull java.util.Optional<java.lang.String>getDriver()Get the driver class name for the methodbooleanisRemote()Whether the method is remote (just checks ifdefaultPortis notnull)booleanisSQL()Whether the method is SQL (just checks ifdriveris notnull)static StorageMethodvalueOf(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.
-
-
-
Enum Constant Detail
-
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 Detail
-
dialect
@NotNull public final @NotNull StorageMethod.DialectFunction dialect
TheDialectconstructor for the method
-
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
-
library
@Nullable public final @Nullable RuntimeLibrary library
TheRuntimeLibraryto download/load if the method requires one
-
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 namejava.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 ifdefaultPortis notnull)- Returns:
trueif the method is remote,falseotherwise
-
isSQL
public boolean isSQL()
Whether the method is SQL (just checks ifdriveris notnull)- Returns:
trueif the method is SQL,falseotherwise
-
get
@NotNull public static @NotNull StorageMethod get(@Nullable @Nullable java.lang.String name)
Get theStorageMethodwith the given name- Parameters:
name- the name of the method- Returns:
- the
StorageMethodwith the given name, orH2if the name isnullor invalid
-
-