Class AbstractVersionProvider<T>
java.lang.Object
org.craftercms.commons.upgrade.impl.providers.AbstractVersionProvider<T>
- Type Parameters:
T- The target type supported
- All Implemented Interfaces:
VersionProvider<T>
- Direct Known Subclasses:
AbstractFileVersionProvider
Base class for all
VersionProvider implementations- Since:
- 3.1.5
- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe default value to use when no version is found, defaults toVersionProvider.SKIPprotected org.slf4j.LoggerFields inherited from interface org.craftercms.commons.upgrade.VersionProvider
SKIP, VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract StringdoGetVersion(UpgradeContext<T> context) protected abstract voiddoSetVersion(UpgradeContext<T> context, String version) getVersion(UpgradeContext<T> context) Returns the current versionvoidsetDefaultValue(String defaultValue) voidsetVersion(UpgradeContext<T> context, String version) Updates the current version
-
Field Details
-
logger
protected org.slf4j.Logger logger -
defaultValue
The default value to use when no version is found, defaults toVersionProvider.SKIP
-
-
Constructor Details
-
AbstractVersionProvider
public AbstractVersionProvider()
-
-
Method Details
-
setDefaultValue
-
getVersion
Description copied from interface:VersionProviderReturns the current version- Specified by:
getVersionin interfaceVersionProvider<T>- Parameters:
context- the upgrade context- Returns:
- version number
- Throws:
UpgradeException- if there is any error getting the current version
-
doGetVersion
- Throws:
Exception
-
setVersion
Description copied from interface:VersionProviderUpdates the current version- Specified by:
setVersionin interfaceVersionProvider<T>- Parameters:
context- the upgrade contextversion- the new version- Throws:
UpgradeException- if there is any error setting the current version
-
doSetVersion
- Throws:
Exception
-