A ChangeSet is itself a BibChange, so sets may nest — a command delegating to a helper
does not have to flatten anything. Only the outermost set is pushed onto the undo stack, so
one user action stays one undo step regardless of nesting.
name is the only text in the change model, and it exists at this granularity because that
is the granularity the user acts in: "Merge entries", not "change field author of entry X".
It is shown to the user: the notification after an undo names the step, and the warning
apply logs when part of a set fails carries it too. So it is named as the user would
recognise the action — from org. where the step comes from
a command, from a localized string otherwise. A developer token here is a defect.
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private static final Logger | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ApplyResult | apply()
Implements org. Applies every change, continuing past a failing one, and reports what did not make it. |
| public List | |
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public ChangeSet | inverted()
Implements org. Reverses the order and inverts each element — both are required for a group to undo correctly, because later changes may depend on earlier ones. |
| public boolean | |
| public String | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| changes | back to summary |
|---|---|
| private final List<BibChange> changes Record Component accessed by changes(). | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| name | back to summary |
|---|---|
| private final String name Record Component accessed by name(). | |
| ChangeSet | back to summary |
|---|---|
| public ChangeSet(String name, List<BibChange> changes) | |
| apply | back to summary |
|---|---|
| public ApplyResult apply() Implements org. Applies every change, continuing past a failing one, and reports what did not make it. Aborting midway would leave the library in a state that is neither the old nor the new one and that no subsequent undo could describe, so a partially applied set is preferred over a partially reverted one. Failures are not propagated, because a caller half-way through a set has no meaningful recovery; they are returned, because a caller that believes the whole set was applied has been told something untrue. Two things come back as failures: an element that threw, and an element that refused because the library no longer holds what it recorded. Failures of nested sets travel up as they are, so what comes back names the changes that failed rather than the sets that contained them.
| |
| changes | back to summary |
|---|---|
| public List Record Component getter of changes. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| inverted | back to summary |
|---|---|
| public ChangeSet inverted() Implements org. Reverses the order and inverts each element — both are required for a group to undo correctly, because later changes may depend on earlier ones.
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() | |
| name | back to summary |
|---|---|
| public String name() Record Component getter of name. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |