Package org.craftercms.commons.upgrade
Interface VersionProvider<T>
- Type Parameters:
T
- The target type supported
- All Known Implementing Classes:
AbstractFileVersionProvider
,AbstractVersionProvider
,YamlFileVersionProvider
public interface VersionProvider<T>
Provides the current version of a specific target
- Since:
- 3.1.5
- Author:
- joseross
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetVersion
(UpgradeContext<T> context) Returns the current versionvoid
setVersion
(UpgradeContext<T> context, String version) Updates the current version
-
Field Details
-
VERSION
Keyword used to retrieve the version- See Also:
-
SKIP
Value used when a file is missing from the repository- See Also:
-
-
Method Details
-
getVersion
Returns the current version- Parameters:
context
- the upgrade context- Returns:
- version number
- Throws:
UpgradeException
- if there is any error getting the current version
-
setVersion
Updates the current version- Parameters:
context
- the upgrade contextversion
- the new version- Throws:
UpgradeException
- if there is any error setting the current version
-