Class KeepCommand<T>

java.lang.Object
org.apache.commons.text.diff.EditCommand<T>
org.apache.commons.text.diff.KeepCommand<T>
Type Parameters:
T - object type

public class KeepCommand<T>
extends EditCommand<T>
Command representing the keeping of one object present in both sequences.

When one object of the first sequence equals another objects in the second sequence at the right place, the edit script transforming the first sequence into the second sequence uses an instance of this class to represent the keeping of this object. The objects embedded in these type of commands always come from the first sequence.

Since:
1.0
See Also:
StringsComparator, EditScript
  • Constructor Details

    • KeepCommand

      public KeepCommand​(T object)
      Simple constructor. Creates a new instance of KeepCommand
      Parameters:
      object - the object belonging to both sequences (the object is a reference to the instance in the first sequence which is known to be equal to an instance in the second sequence)
  • Method Details