T - data type for KeyU - data type for Record (value)public interface Storable<T,U>
public class ABC implements Storable <String, String> { ... }
| Modifier and Type | Method and Description |
|---|---|
default <E extends Exception> |
close()
Close database connection.
|
<E extends Exception> |
delete(T key)
Delete a record
|
<E extends Exception> |
get(T key)
Get a record for the key.
|
<E extends Exception> |
set(T key,
U rec)
Add a record with the key.
|
default <E extends Exception> |
update(T key,
UnaryOperator<U> fUpdate)
Update a record
|
<E extends Exception> U get(T key) throws E extends Exception
E - any exceptionkey - to the recordE - any exceptionE extends Exception<E extends Exception> void set(T key, U rec) throws E extends Exception
E - any exceptionkey - to the record.rec - to save.E - any exceptionE extends Exception<E extends Exception> boolean delete(T key) throws E extends Exception
E - any exceptionkey - to the recordE - any exceptionE extends Exceptiondefault <E extends Exception> boolean update(T key, UnaryOperator<U> fUpdate) throws E extends Exception
E - any exceptionkey - to the recordfUpdate - function to update the record. e.g. f(currentRecord) returns newRecord.E - any exceptionE extends ExceptionCopyright © 2023. All rights reserved.