Class MySqlStorageProvider<K,V>
java.lang.Object
dev.crafty.core.storage.AbstractStorageProvider<K,V>
dev.crafty.core.storage.providers.MySqlStorageProvider<K,V>
- All Implemented Interfaces:
StorageProvider<K,
V>
-
Field Summary
Fields inherited from class dev.crafty.core.storage.AbstractStorageProvider
valueType
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class dev.crafty.core.storage.AbstractStorageProvider
exists, serializeKey
-
Constructor Details
-
MySqlStorageProvider
-
-
Method Details
-
initialize
Description copied from interface:StorageProvider
Initializes the storage provider. This method should be called before using the provider.- Specified by:
initialize
in interfaceStorageProvider<K,
V> - Overrides:
initialize
in classAbstractStorageProvider<K,
V> - Returns:
- A CompletableFuture that completes when initialization is done
-
save
Description copied from interface:StorageProvider
Saves an object to the storage.- Parameters:
key
- The key to identify the objectvalue
- The object to save- Returns:
- A CompletableFuture that completes when the operation is done
-
get
Description copied from interface:StorageProvider
Retrieves an object from the storage.- Parameters:
key
- The key of the object to retrieve- Returns:
- A CompletableFuture that completes with the retrieved object, or empty if not found
-
getAll
Description copied from interface:StorageProvider
Retrieves all objects from the storage.- Returns:
- A CompletableFuture that completes with a collection of all objects
-
delete
Description copied from interface:StorageProvider
Deletes an object from the storage.- Parameters:
key
- The key of the object to delete- Returns:
- A CompletableFuture that completes when the operation is done
-
close
Description copied from interface:StorageProvider
Closes the storage provider and releases any resources. This method should be called when the provider is no longer needed.- Specified by:
close
in interfaceStorageProvider<K,
V> - Overrides:
close
in classAbstractStorageProvider<K,
V> - Returns:
- A CompletableFuture that completes when the provider is closed
-