public class CompositeMemento extends Object implements Memento
MementoOriginator
s.Constructor and Description |
---|
CompositeMemento(Collection<? extends MementoOriginator> originators)
Create a composite memento for all given originators.
|
CompositeMemento(Collection<? extends MementoOriginator> originators,
boolean saveImmediately)
Create a composite memento for all given originators.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear this memento so that
restore() ing will have no effect. |
void |
restore()
Restore this memento's originator to its state at the time when this memento was created.
|
void |
save()
Update this memento's state with the current state of the originators given at construction
time.
|
public CompositeMemento(Collection<? extends MementoOriginator> originators)
restore()
on this composite memento will restore
all mementos provided by the those originators.originators
- the memento originatorspublic CompositeMemento(Collection<? extends MementoOriginator> originators, boolean saveImmediately)
restore()
on this
composite memento will restore all mementos provided by the those originators. If
saveImmediately
is true
, mementos will be requested immediately for
all member originators. Otherwise they can be requested later on using save()
.originators
- the memento originatorssaveImmediately
- whether to save the member mementos immediatelypublic void save()
public void clear()
restore()
ing will have no effect.Copyright © 2024 levigo holding gmbh. All rights reserved.