ApplyChangeOptions
Leave feedback
On this page
Inheritance: java.lang.Object
public class ApplyChangeOptions
Allows updating the list of changes before applying them to the resulting document.
Example usage:
try (Comparer comparer = new Comparer(sourceFile)) {
comparer.add(targetFile);
comparer.compare();
ChangeInfo[] changes = comparer.getChanges();
changes[0].setComparisonAction(ComparisonAction.REJECT);
final ApplyChangeOptions applyChangeOptions = new ApplyChangeOptions(changes);
comparer.applyChanges(resultFile, applyChangeOptions);
}
| Constructor | Description |
|---|---|
| ApplyChangeOptions() | Initializes a new instance of the ApplyChangeOptions class. |
| ApplyChangeOptions(List |
Initializes a new instance of the ApplyChangeOptions class with list of changes. |
| ApplyChangeOptions(ChangeInfo[] changes) | Initializes a new instance of the ApplyChangeOptions class with array of changes. |
| Method | Description |
|---|---|
| getChanges() | Gets an array of changes that must be applied to the resulting document. |
| setChanges(ChangeInfo[] value) | Sets an array of changes that must be applied to the resulting document. |
| setChanges(List |
Sets a list of changes that must be applied to the resulting document. |
| isSaveOriginalState() | Gets a flag that determines is original state should be saved. |
| setSaveOriginalState(boolean saveOriginalState) | Sets a flag that determines is original state should be saved. |
public ApplyChangeOptions()
Initializes a new instance of the ApplyChangeOptions class.
public ApplyChangeOptions(List<ChangeInfo> changes)
Initializes a new instance of the ApplyChangeOptions class with list of changes.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| changes | java.util.List<com.groupdocs.comparison.result.ChangeInfo> | The list of changes to be applied |
public ApplyChangeOptions(ChangeInfo[] changes)
Initializes a new instance of the ApplyChangeOptions class with array of changes.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| changes | ChangeInfo[] | The list of changes to be applied |
public final ChangeInfo[] getChanges()
Gets an array of changes that must be applied to the resulting document.
Returns: com.groupdocs.comparison.result.ChangeInfo[] - the array of changes to be applied
public final void setChanges(ChangeInfo[] value)
Sets an array of changes that must be applied to the resulting document.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | ChangeInfo[] | The array of changes to be applied |
public final void setChanges(List<ChangeInfo> value)
Sets a list of changes that must be applied to the resulting document.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.util.List<com.groupdocs.comparison.result.ChangeInfo> | The list of changes to be applied |
public boolean isSaveOriginalState()
Gets a flag that determines is original state should be saved. Default value: false.
Returns: boolean - true if original state should be saved, otherwise false
public void setSaveOriginalState(boolean saveOriginalState)
Sets a flag that determines is original state should be saved.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| saveOriginalState | boolean | True if original state should be saved, otherwise false |
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.