org.xwiki.diff
Interface Patch<E>

Type Parameters:
E - the type of compared elements
All Superinterfaces:
Collection<Delta<E>>, Iterable<Delta<E>>, List<Delta<E>>

public interface Patch<E>
extends List<Delta<E>>

A list of deltas between two versions.

Version:
$Id: a72ff1acf4150c51534176ccfd3b936cc2a4a9bc $

Method Summary
 List<E> apply(List<E> target)
          Apply the patch.
 List<E> restore(List<E> target)
          Invert the patch.
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Method Detail

apply

List<E> apply(List<E> target)
              throws PatchException
Apply the patch.

Parameters:
target - the list on which to apply the patch
Returns:
the modified list
Throws:
PatchException - failed to apply the patch

restore

List<E> restore(List<E> target)
                throws PatchException
Invert the patch.

Parameters:
target - the list on which to apply an inverted version of the patch
Returns:
the modified list
Throws:
PatchException - failed to apply the patch


Copyright © 2004–2014 XWiki. All rights reserved.