public enum RevisionAction extends Enum<RevisionAction>
Example usage:
try (RevisionHandler revisionHandler = new RevisionHandler(sourceFile)) {
List<RevisionInfo> revisionList = revisionHandler.getRevisions();
for (RevisionInfo revisionInfo : revisionList) {
if (revisionInfo.getType() == RevisionType.DELETION)
// Set an action to be applied to the revision
revisionInfo.setAction(RevisionAction.Accept);
}
// Create an instance of ApplyRevisionOptions
ApplyRevisionOptions revisionChanges = new ApplyRevisionOptions();
revisionChanges.setChanges(revisionList);
// Apply the revisions using the options
revisionHandler.applyRevisionChanges(resultFile, revisionChanges);
}
RevisionHandler,
ApplyRevisionOptions,
RevisionInfo,
RevisionAction| Enum Constant and Description |
|---|
ACCEPT
Indicates that the revision will be displayed if it is of type INSERTION, or it will be removed if the type is DELETION.
|
NONE
Indicates that no action is to be taken.
|
REJECT
Indicates that the revision will be removed if it is of type INSERTION, or it will be displayed if the type is DELETION.
|
| Modifier and Type | Method and Description |
|---|---|
static RevisionAction |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RevisionAction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RevisionAction ACCEPT
public static final RevisionAction NONE
public static final RevisionAction REJECT
public static RevisionAction 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 RevisionAction[] values()
for (RevisionAction c : RevisionAction.values()) System.out.println(c);
Copyright © 2024. All rights reserved.