Implementations are value objects: they hold the data needed to perform the change and the
data needed to undo it, and derive the undo direction from that rather than implementing it
separately. Undoing is therefore not a distinct operation — it is change.inverted().apply().
Implementations carry no user-facing text. A description exists only at the granularity a
user acts in, as the name of the enclosing ChangeSet.
| Modifier and Type | Method and Description |
|---|---|
| public ApplyResult | |
| public BibChange |
| apply | back to summary |
|---|---|
| public ApplyResult apply() Performs this change. Implementations hold whatever they need to act on — an entry, a string, the database — so that recording a change never requires plumbing a context to the call site. A change that describes one value refuses when the library no longer holds that value, because a command writing on a background thread can have moved it on since, and writing over it would produce a library no step on the stack describes. A change that describes a collection or a whole subtree applies unconditionally: comparing all of it on every apply costs more than the case is worth, and a partial comparison would only look like a check. A change describing one modification performs it or throws, and so always returns
| |
| inverted | back to summary |
|---|---|
| public BibChange inverted() The change that reverses this one. Must be an involution: | |