@Retention(value=RUNTIME)
public @interface OnDiff
DiffSectionSpec
requires a method with this annotation. This
method is responsible for generating a ChangeSet
.
@OnDiff
public static void onCreateChangeSet(
SectionContext context,
ChangeSet changeSet,
@Prop Diff<Component>
component) {
if (component.getNext() == null) {
changeSet.delete(0);
} else if (component.getPrevious() == null) {
changeSet.insert(0, component.getNext());
}
}