Class PostgresStorageProvider<K,V>
java.lang.Object
dev.crafty.core.storage.AbstractStorageProvider<K,V>
dev.crafty.core.storage.providers.PostgresStorageProvider<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
-
PostgresStorageProvider
-
-
Method Details
-
initialize
Description copied from interface:StorageProviderInitializes the storage provider. This method should be called before using the provider.- Specified by:
initializein interfaceStorageProvider<K,V> - Overrides:
initializein classAbstractStorageProvider<K,V> - Returns:
- A CompletableFuture that completes when initialization is done
-
save
Description copied from interface:StorageProviderSaves 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:StorageProviderRetrieves 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:StorageProviderRetrieves all objects from the storage.- Returns:
- A CompletableFuture that completes with a collection of all objects
-
delete
Description copied from interface:StorageProviderDeletes 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: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> - Overrides:
closein classAbstractStorageProvider<K,V> - Returns:
- A CompletableFuture that completes when the provider is closed
-