public enum ChangeType extends Enum<ChangeType>
Each constant in this enum represents a specific type of change 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) {
// Get the ChangeType for a specific change
final ChangeType changeType = changeInfo.getType();
// Print the ChangeType information
System.out.println("Description: " + changeType.toString());
System.out.println("Value: " + changeType.toInt());
}
}
Comparer,
ChangeInfo| Enum Constant and Description |
|---|
ADDED
Represents an added change.
|
DELETED
Represents a deleted change.
|
INSERTED
Represents an inserted change.
|
MODIFIED
Represents a modified change.
|
MOVED
Represents a moved change.
|
MOVED_AND_RESIZED
Represents a moved and resized change.
|
NONE
Represents no change.
|
NOT_MODIFIED
Represents a not modified change.
|
RESIZED
Represents a resized change.
|
SHIFTED_AND_RESIZED
Represents a shifted and resized change.
|
STYLE_CHANGED
Represents a style changed change.
|
| Modifier and Type | Method and Description |
|---|---|
static ChangeType |
fromInt(int intValue)
Creates new constant of enum ChangeType using provided numeric value.
|
static ChangeType |
fromString(String toStringValue)
Parses string representation of ChangeType to get the enum constant.
|
int |
toInt()
Numeric representation of ChangeType.
|
String |
toString()
String representation of ChangeType.
|
static ChangeType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ChangeType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ChangeType ADDED
public static final ChangeType DELETED
public static final ChangeType INSERTED
public static final ChangeType MODIFIED
public static final ChangeType MOVED
public static final ChangeType MOVED_AND_RESIZED
public static final ChangeType NONE
public static final ChangeType NOT_MODIFIED
public static final ChangeType RESIZED
public static final ChangeType SHIFTED_AND_RESIZED
public static final ChangeType STYLE_CHANGED
public static ChangeType fromInt(int intValue)
Creates new constant of enum ChangeType using provided numeric value.
intValue - The numeric representation of ChangeTypeIllegalArgumentException - if numeric value is not one of ChangeType valuespublic static ChangeType fromString(String toStringValue)
Parses string representation of ChangeType to get the enum constant.
toStringValue - The string representation of ChangeTypeIllegalArgumentException - if string is not one of ChangeType valuespublic int toInt()
Numeric representation of ChangeType.
public String toString()
String representation of ChangeType.
toString in class Enum<ChangeType>public static ChangeType 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 ChangeType[] values()
for (ChangeType c : ChangeType.values()) System.out.println(c);
Copyright © 2024. All rights reserved.