CTX
- The context type to use, can by any Component
, service
or POJO.RET
- The return type of the Undoable
's proceedings.public abstract class AbstractUndoable<CTX,RET,E extends Exception> extends AbstractCommand<CTX,RET,E> implements Undoable<CTX,RET,E>
AbstractUndoable
implements the Undoable
interface.Constructor and Description |
---|
AbstractUndoable() |
Modifier and Type | Method and Description |
---|---|
boolean |
isUndoable()
This method determines whether the
Undoable can undo the
work it has done. |
void |
undo(CTX aContext)
This method tries to undo the
Undoable in case it was
successfully executed. |
reset
public boolean isUndoable()
Undoable
Undoable
can undo the
work it has done.public void undo(CTX aContext) throws NotUndoableRuntimeException, UnsupportedOperationException
Undoable
Undoable
in case it was
successfully executed. Test via Undoable.isUndoable()
beforehand to see
whether a call to Undoable.undo(Object)
can be applied.undo
in interface Undoable<CTX,RET,E extends Exception>
aContext
- The target object which is used by the
Undoable
to do its Undoable
.NotUndoableRuntimeException
- Thrown in case the performed
operation cannot be undone, or no operation as been done before
by this Undoable
.UnsupportedOperationException
- Thrown in case the
Undoable
does not provide undo facilities.Copyright © 2016. All rights reserved.