public enum ComparisonAction extends Enum<ComparisonAction>
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);
}
Comparer,
ChangeInfo| Enum Constant and Description |
|---|
ACCEPT
Represents an accept action.
|
NONE
Represents no action.
|
REJECT
Represents a reject action.
|
| Modifier and Type | Method and Description |
|---|---|
static ComparisonAction |
fromInt(int intValue)
Creates new constant of enum ComparisonAction using provided numeric value.
|
static ComparisonAction |
fromString(String toStringValue)
Parses string representation of ComparisonAction to get the enum constant.
|
int |
toInt()
Numeric representation of ComparisonAction.
|
String |
toString()
String representation of ComparisonAction.
|
static ComparisonAction |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ComparisonAction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ComparisonAction ACCEPT
public static final ComparisonAction NONE
public static final ComparisonAction REJECT
public static ComparisonAction fromInt(int intValue)
Creates new constant of enum ComparisonAction using provided numeric value.
intValue - The numeric representation of ComparisonActionIllegalArgumentException - if numeric value is not one of ComparisonAction valuespublic static ComparisonAction fromString(String toStringValue)
Parses string representation of ComparisonAction to get the enum constant.
toStringValue - The string representation of ComparisonActionIllegalArgumentException - if string is not one of ComparisonAction valuespublic int toInt()
Numeric representation of ComparisonAction.
public String toString()
String representation of ComparisonAction.
toString in class Enum<ComparisonAction>public static ComparisonAction valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static ComparisonAction[] values()
for (ComparisonAction c : ComparisonAction.values()) System.out.println(c);
Copyright © 2024. All rights reserved.