ComparisonAction
Leave feedback
On this page
Inheritance: java.lang.Object, java.lang.Enum
public enum ComparisonAction extends Enum<ComparisonAction>
The ComparisonAction enum represents the actions that can be applied to a change during the document comparison process.
Each constant in this enum represents a specific action and provides a human-readable description and a numeric value.
Example usage:
try (Comparer comparer = new Comparer(sourceFile)) {
comparer.add(targetFile);
comparer.compare();
final ChangeInfo[] changes = comparer.getChanges();
for (ChangeInfo changeInfo : changes) {
if (changeInfo.getId() % 2 == 0) {
changeInfo.setComparisonAction(ComparisonAction.REJECT);
}
}
comparer.applyChanges(resultFile, changes);
}
| Field | Description |
|---|---|
| NONE | Represents no action. |
| ACCEPT | Represents an accept action. |
| REJECT | Represents a reject action. |
| Method | Description |
|---|---|
| values() | |
| valueOf(String name) | |
| fromString(String toStringValue) | Parses string representation of ComparisonAction to get the enum constant. |
| fromInt(int intValue) | Creates new constant of enum ComparisonAction using provided numeric value. |
| toString() | String representation of ComparisonAction. |
| toInt() | Numeric representation of ComparisonAction. |
public static final ComparisonAction NONE
Represents no action. The change will have no effect.
public static final ComparisonAction ACCEPT
Represents an accept action. The change will be visible in the result file.
public static final ComparisonAction REJECT
Represents a reject action. The change will be invisible in the result file.
public static ComparisonAction[] values()
Returns: com.groupdocs.comparison.result.ComparisonAction[]
public static ComparisonAction valueOf(String name)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| name | java.lang.String |
Returns: ComparisonAction
public static ComparisonAction fromString(String toStringValue)
Parses string representation of ComparisonAction to get the enum constant.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| toStringValue | java.lang.String | The string representation of ComparisonAction |
Returns: ComparisonAction - ComparisonAction enum constant associated with input string
public static ComparisonAction fromInt(int intValue)
Creates new constant of enum ComparisonAction using provided numeric value.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| intValue | int | The numeric representation of ComparisonAction |
Returns: ComparisonAction - ComparisonAction enum constant associated with numeric value
public String toString()
String representation of ComparisonAction.
Returns: java.lang.String - string value of enum constant
public int toInt()
Numeric representation of ComparisonAction.
Returns: int - numeric value of enum constant
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.