CompoundDiff (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne.graph, class: CompoundDiff

# Class CompoundDiff

java.lang.Object
org.apache.cayenne.graph.CompoundDiff

All Implemented Interfaces:
  `Serializable, GraphDiff`

public class CompoundDiff extends Object implements GraphDiff
A GraphDiff that is a list of other GraphDiffs.

Since:
  1.2
See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected List<GraphDiff>`
  `diffs`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CompoundDiff()`
  Creates an empty CompoundDiff instance.
  `CompoundDiff(List<GraphDiff> diffs)`
  Creates CompoundDiff instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(GraphDiff diff)`
  `void`
  `addAll(Collection<? extends GraphDiff> diffs)`
  `void`
  `apply(GraphChangeHandler tracker)`
  Iterates over diffs list, calling "apply" on each individual diff.
  `List<GraphDiff>`
  `getDiffs()`
  `boolean`
  `isNoop()`
  Returns true if this diff has no other diffs or if all of its diffs are noops.
  `void`
  `undo(GraphChangeHandler tracker)`
  Iterates over diffs list in reverse order, calling "apply" on each individual diff.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### diffs

    protected List<GraphDiff> diffs

- ## Constructor Details

  - ### CompoundDiff

    public CompoundDiff()
    Creates an empty CompoundDiff instance.

  - ### CompoundDiff

    public CompoundDiff(List<GraphDiff> diffs)
    Creates CompoundDiff instance. Note that a List is not cloned in this constructor, so subsequent calls to add and addAll would modify the original list.

- ## Method Details

  - ### isNoop

    public boolean isNoop()
    Returns true if this diff has no other diffs or if all of its diffs are noops.
    Specified by:
      `isNoop` in interface `GraphDiff`

  - ### getDiffs

    public List<GraphDiff> getDiffs()

  - ### add

    public void add(GraphDiff diff)

  - ### addAll

    public void addAll(Collection<? extends GraphDiff> diffs)

  - ### apply

    public void apply(GraphChangeHandler tracker)
    Iterates over diffs list, calling "apply" on each individual diff.
    Specified by:
      `apply` in interface `GraphDiff`

  - ### undo

    public void undo(GraphChangeHandler tracker)
    Iterates over diffs list in reverse order, calling "apply" on each individual diff.
    Specified by:
      `undo` in interface `GraphDiff`