public class VersionHelper extends Object
Constructor and Description |
---|
VersionHelper() |
Modifier and Type | Method and Description |
---|---|
static Object |
getNextVersion(VersionStrategy versionStrategy,
Object currentVersion)
Convenience method to provide the next version, using the version strategy given the
supplied current version.
|
static void |
performVersionCheck(ObjectProvider op,
Object versionDatastore,
VersionMetaData versionMetaData)
Perform an optimistic version check on the passed object, against the passed version in the datastore.
|
public static void performVersionCheck(ObjectProvider op, Object versionDatastore, VersionMetaData versionMetaData)
op
- ObjectProvider of the object to checkversionDatastore
- Version of the object in the datastoreversionMetaData
- VersionMetaData to use for checkingNucleusUserException
- thrown when an invalid strategy is specifiedNucleusOptimisticException
- thrown when the version check failspublic static Object getNextVersion(VersionStrategy versionStrategy, Object currentVersion)
versionStrategy
- Version strategycurrentVersion
- The current versionNucleusUserException
- Thrown if the strategy is not supported.Copyright © 2017. All rights reserved.