Add ObservableChangeManager interface with wrapper implementation
All checks were successful
zdm/undo-redo/pipeline/head This commit looks good

This commit is contained in:
2021-12-12 08:05:24 +01:00
parent d49772a127
commit 1b6d7f3dde
5 changed files with 164 additions and 3 deletions

View File

@ -26,7 +26,7 @@ public interface ChangeManager<C extends Change> {
* @return the change that was applied last
* @since 0.0.1
*/
Optional<Change> getLastChange();
Optional<C> getLastChange();
/**
* Undoes the current change.

View File

@ -23,7 +23,7 @@ public final class UnlimitedChangeManager<C extends Change> implements ChangeMan
}
@Override
public Optional<Change> getLastChange() {
public Optional<C> getLastChange() {
return index == -1 ? Optional.empty() : Optional.of(changes.get(index));
}