Class DefaultBuildVersionRegistry
- All Implemented Interfaces:
BuildVersionRegistry
- Since:
- v4.1
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.upgrade.BuildVersionRegistry
BuildVersionRegistry.BuildVersion
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetBuildNumberForVersion
(String targetVersion) Takes a version string and attempts to resolve it to a released (or unreleased during development) build number of JIRA.getVersionForBuildNumber
(int buildNumber) Takes a build number and attempts to resolve it to a released (or unreleased during development) version of JIRA.getVersionForBuildNumber
(String targetBuildNumber) Takes a build number and attempts to resolve it to a released (or unreleased during development) version of JIRA.
-
Constructor Details
-
DefaultBuildVersionRegistry
-
-
Method Details
-
getVersionForBuildNumber
Description copied from interface:BuildVersionRegistry
Takes a build number and attempts to resolve it to a released (or unreleased during development) version of JIRA. If the build number does not directly correspond to a released version of JIRA, we attempt to infer the version by searching for the next known build number above the input.
For example, if the build number is
207
, the version returned would be3.8
, as it has a build number of209
. In this case, the resultingBuildVersionRegistry.BuildVersion
object will have a build number corresponding to the target build number and not the input build number, as the target build number is the official number against that version.If the input build number is higher than any known build number, we return the currently running version of JIRA.
- Specified by:
getVersionForBuildNumber
in interfaceBuildVersionRegistry
- Parameters:
buildNumber
- the build number to look up- Returns:
- the version that corresponds to this build number.
-
getVersionForBuildNumber
Description copied from interface:BuildVersionRegistry
Takes a build number and attempts to resolve it to a released (or unreleased during development) version of JIRA. If the build number does not directly correspond to a released version of JIRA, we attempt to infer the version by searching for the next known build number above the input.
For example, if the build number is
207
, the version returned would be3.8
, as it has a build number of209
. In this case, the resultingBuildVersionRegistry.BuildVersion
object will have a build number corresponding to the target build number and not the input build number, as the target build number is the official number against that version.If the input build number is higher than any known build number, we return the currently running version of JIRA.
- Specified by:
getVersionForBuildNumber
in interfaceBuildVersionRegistry
- Parameters:
targetBuildNumber
- the build number to look up; must be not null and parseable to an integer.- Returns:
- the version that corresponds to this build number.
-
getBuildNumberForVersion
Description copied from interface:BuildVersionRegistry
Takes a version string and attempts to resolve it to a released (or unreleased during development) build number of JIRA. If the version string does not directly correspond to a released build number, return MAX_INT
- Specified by:
getBuildNumberForVersion
in interfaceBuildVersionRegistry
- Parameters:
targetVersion
- the version string to look up (e.g.6.0.5
); must be not null.- Returns:
- the build number that corresponds to this version.
-