Package dev.crafty.core.storage
Class AbstractStorageProvider<K,V>
java.lang.Object
dev.crafty.core.storage.AbstractStorageProvider<K,V>
- All Implemented Interfaces:
StorageProvider<K,
V>
- Direct Known Subclasses:
MongoDbStorageProvider
,MySqlStorageProvider
,PostgresStorageProvider
,YamlStorageProvider
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclose()
Closes the storage provider and releases any resources.Checks if an object exists in the storage.Initializes the storage provider.protected String
serializeKey
(K key) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.crafty.core.storage.StorageProvider
delete, get, getAll, save
-
Field Details
-
valueType
-
-
Constructor Details
-
AbstractStorageProvider
-
-
Method Details
-
serializeKey
-
exists
Description copied from interface:StorageProvider
Checks if an object exists in the storage.- Specified by:
exists
in interfaceStorageProvider<K,
V> - Parameters:
key
- The key to check- Returns:
- A CompletableFuture that completes with true if the object exists, false otherwise
-
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> - Returns:
- A CompletableFuture that completes when initialization 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> - Returns:
- A CompletableFuture that completes when the provider is closed
-