Class GerritVersionChecker
- java.lang.Object
-
- com.sonyericsson.hudson.plugins.gerrit.trigger.version.GerritVersionChecker
-
public final class GerritVersionChecker extends Object
Util class used to determine if the current Gerrit version is high enough to run a specific feature..- Author:
- Tomas Westling <thomas.westling@sonyericsson.com>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GerritVersionChecker.Feature
The feature version we want to compare the current Gerrit version with.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GerritVersionNumber
createVersionNumber(String version)
Creates a new VersionNumber from the response of the gerrit server.static boolean
isCorrectVersion(GerritVersionChecker.Feature feature, String serverName)
Tells us if we are running the correct version for a particular feature.static boolean
isCorrectVersion(GerritVersionChecker.Feature feature, String serverName, boolean excludeSnapshotVersions)
Tells us if we are running the correct version for a particular feature.static boolean
isCorrectVersion(GerritVersionNumber gerritVersion, GerritVersionChecker.Feature feature)
Tells us if we are running the correct version for a particular feature.static boolean
isCorrectVersion(GerritVersionNumber gerritVersion, GerritVersionChecker.Feature feature, boolean excludeSnapshotVersions)
Tells us if we are running the correct version for a particular feature.
-
-
-
Method Detail
-
isCorrectVersion
public static boolean isCorrectVersion(GerritVersionChecker.Feature feature, String serverName)
Tells us if we are running the correct version for a particular feature.- Parameters:
feature
- the feature we want to check.serverName
- the name of the Gerrit server.- Returns:
- true if the Gerrit version is high enough for us to use this feature.
-
isCorrectVersion
public static boolean isCorrectVersion(GerritVersionChecker.Feature feature, String serverName, boolean excludeSnapshotVersions)
Tells us if we are running the correct version for a particular feature.- Parameters:
feature
- the feature we want to check.serverName
- the name of the Gerrit server.excludeSnapshotVersions
- exclude snapshot versions from feature checks.- Returns:
- true if the Gerrit version is high enough for us to use this feature.
-
isCorrectVersion
public static boolean isCorrectVersion(GerritVersionNumber gerritVersion, GerritVersionChecker.Feature feature, boolean excludeSnapshotVersions)
Tells us if we are running the correct version for a particular feature.- Parameters:
gerritVersion
- the version of Gerrit we are running.feature
- the feature we want to check.excludeSnapshotVersions
- exclude snapshots from feature check.- Returns:
- true if the Gerrit version is high enough for us to use this feature.
-
isCorrectVersion
public static boolean isCorrectVersion(GerritVersionNumber gerritVersion, GerritVersionChecker.Feature feature)
Tells us if we are running the correct version for a particular feature.- Parameters:
gerritVersion
- the version of Gerrit we are running.feature
- the feature we want to check.- Returns:
- true if the Gerrit version is high enough for us to use this feature.
-
createVersionNumber
public static GerritVersionNumber createVersionNumber(String version)
Creates a new VersionNumber from the response of the gerrit server.- Parameters:
version
- the version as a String.- Returns:
- the version as a versionNumber.
-
-