public class ApplyRevisionOptions extends Object
It provides various constructors and properties to customize the revision application process.
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,
RevisionInfo,
RevisionAction| Constructor and Description |
|---|
ApplyRevisionOptions()
Initializes a new instance of the ApplyRevisionOptions class.
|
ApplyRevisionOptions(List<RevisionInfo> changes)
Instantiates a new ApplyRevisionOptions object with the specified list of revisions.
|
ApplyRevisionOptions(List<RevisionInfo> changes,
RevisionAction revisionAction)
Instantiates a new ApplyRevisionOptions object with the specified list of revisions and a common revision action.
|
ApplyRevisionOptions(RevisionAction revisionAction)
Instantiates a new ApplyRevisionOptions object with a common revision action.
|
| Modifier and Type | Method and Description |
|---|---|
List<RevisionInfo> |
getChanges()
Gets the list of revisions to be applied.
|
RevisionAction |
getCommonHandler()
Gets the common revision action to be applied to all revisions.
|
void |
setChanges(List<RevisionInfo> changes)
Sets the list of revisions to be applied.
|
void |
setCommonHandler(RevisionAction commonHandler)
Sets the common revision action to be applied to all revisions.
|
public ApplyRevisionOptions()
public ApplyRevisionOptions(List<RevisionInfo> changes)
changes - The list of revisions to be appliedpublic ApplyRevisionOptions(List<RevisionInfo> changes, RevisionAction revisionAction)
changes - The list of revisions to be appliedrevisionAction - The common revision action to be applied to all revisionspublic ApplyRevisionOptions(RevisionAction revisionAction)
revisionAction - The common revision action to be applied to all revisionspublic List<RevisionInfo> getChanges()
public RevisionAction getCommonHandler()
public void setChanges(List<RevisionInfo> changes)
changes - The list of revisionspublic void setCommonHandler(RevisionAction commonHandler)
commonHandler - The common revision actionCopyright © 2024. All rights reserved.