public interface BaseStorageService<TKey,T extends ObjectWithId<TKey>,TDataStore> extends StorageService<TKey,T,TDataStore>
| Modifier and Type | Method and Description |
|---|---|
default T |
generateEmpty() |
default java.util.concurrent.CompletableFuture<java.lang.Boolean> |
parseAndDeleteOne(java.lang.Object idOrTime)
Attempts to delete a matching
document by
parsing provided Object. |
default java.util.concurrent.CompletableFuture<java.util.Optional<T>> |
parseAndGetOne(java.lang.Object idOrTime)
Attempts to find a matching
document by
parsing provided Object. |
deleteOne, deleteOne, getAll, getAllIds, getOne, getOne, getTClass, insert, insertOnegetDataStoreContext, getTKeyClass, parse, parseUnsafedefault T generateEmpty()
generateEmpty in interface StorageService<TKey,T extends ObjectWithId<TKey>,TDataStore>Tdefault java.util.concurrent.CompletableFuture<java.util.Optional<T>> parseAndGetOne(java.lang.Object idOrTime)
StorageServicedocument by
parsing provided Object.
Will first attempt to parse the provided Object
as an id. If parsing is successful, will return the
result of StorageService.getOne(Object).
If parsing as an id is unsuccessful, will attempt to parse
the provided Object as createdUtc. If parsing is successful,
will return the result of StorageService.getOne(Instant)
Note: if id parsing is successful but no document is found, will not attempt to parse as time
parseAndGetOne in interface StorageService<TKey,T extends ObjectWithId<TKey>,TDataStore>idOrTime - Object to parse. Can be an actual instance of
TKey or a String representation. Can
also be wrapped in an OptionalOptional containing a matching document
if successful, otherwise Optional.empty()Component.parseUnsafe(Object),
Component.parse(Object),
TimeFormatService.parseInstantUnsafe(String),
TimeFormatService.parseInstant(String)default java.util.concurrent.CompletableFuture<java.lang.Boolean> parseAndDeleteOne(java.lang.Object idOrTime)
StorageServicedocument by
parsing provided Object.
Will first attempt to parse the provided Object
as an id. If parsing is successful, will return the
result of StorageService.deleteOne(Object).
If parsing as an id is unsuccessful, will attempt to parse
the provided Object as createdUtc. If parsing is successful,
will return the result of StorageService.deleteOne(Instant)
Note: if id parsing is successful but no document is found, will not attempt to parse as time
parseAndDeleteOne in interface StorageService<TKey,T extends ObjectWithId<TKey>,TDataStore>idOrTime - Object to parse. Can be an actual instance of
TKey or a String representation. Can
also be wrapped in an Optionaldocument was found and deletedComponent.parseUnsafe(Object),
Component.parse(Object),
TimeFormatService.parseInstantUnsafe(String),
TimeFormatService.parseInstant(String)