Package com.storedobject.ui
Interface ObjectSaver<T extends StoredObject>
- Type Parameters:
T- The type of object to be saved, must extendStoredObject.
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional interface to define a contract for saving objects of type
T
that extend StoredObject. Implementations of this interface should
define how to persist the given object within the context of a provided
transaction.- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptionvoidsave(Transaction transaction, T object) Saves the provided object of typeTwithin the context of the specified transaction.
-
Method Details
-
save
Saves the provided object of typeTwithin the context of the specified transaction. Implementations should define the persistence logic. If any error occurs during the save operation, an exception is thrown.- Parameters:
transaction- The transaction context in which the object is to be saved.object- The object of typeTto be saved. It must extendStoredObject.- Throws:
Exception- If an error occurs during the save operation.
-