Package xyz.srnyx.annoyingapi.storage
Enum Class StorageMethod
- All Implemented Interfaces:
Serializable,Comparable<StorageMethod>,Constable
Available storage methods for the plugin
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal @Nullable IntegerThe default port for the method (only for remote connections)final @NotNull StorageMethod.DialectFunctionTheDialectconstructor for the methodfinal @Nullable RuntimeLibraryTheRuntimeLibraryto download/load if the method requires oneLocal SQL: The full URL for the method
Remote SQL: The beginning of the URL for the method
Local Readable:null -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull StorageMethodGet theStorageMethodwith the given nameGet 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 StorageMethodReturns the enum constant of this class with the specified name.static StorageMethod[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
H2
H2 storage method -
SQLITE
SQLite storage method -
MYSQL
MySQL storage method -
MARIADB
MariaDB storage method -
POSTGRESQL
PostgreSQL storage method -
JSON
JSON storage method -
YAML
YAML storage method
-
-
Field Details
-
dialect
TheDialectconstructor for the method -
url
Local SQL: The full URL for the method
Remote SQL: The beginning of the URL for the method
Local Readable:null -
library
TheRuntimeLibraryto download/load if the method requires one -
defaultPort
The default port for the method (only for remote connections)
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
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
Get theStorageMethodwith the given name- Parameters:
name- the name of the method- Returns:
- the
StorageMethodwith the given name, orH2if the name isnullor invalid
-