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 StringserializeKey(K key) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:StorageProviderChecks if an object exists in the storage.- Specified by:
existsin 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:StorageProviderInitializes the storage provider. This method should be called before using the provider.- Specified by:
initializein interfaceStorageProvider<K,V> - Returns:
- A CompletableFuture that completes when initialization is done
-
close
Description copied from interface:StorageProviderCloses the storage provider and releases any resources. This method should be called when the provider is no longer needed.- Specified by:
closein interfaceStorageProvider<K,V> - Returns:
- A CompletableFuture that completes when the provider is closed
-