Class GerritVersionChecker
java.lang.Object
com.sonyericsson.hudson.plugins.gerrit.trigger.version.GerritVersionChecker
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 ClassesModifier and TypeClassDescriptionstatic enumThe feature version we want to compare the current Gerrit version with. -
Method Summary
Modifier and TypeMethodDescriptionstatic GerritVersionNumbercreateVersionNumber(String version) Creates a new VersionNumber from the response of the gerrit server.static booleanisCorrectVersion(GerritVersionChecker.Feature feature, String serverName) Tells us if we are running the correct version for a particular feature.static booleanisCorrectVersion(GerritVersionChecker.Feature feature, String serverName, boolean excludeSnapshotVersions) Tells us if we are running the correct version for a particular feature.static booleanisCorrectVersion(GerritVersionNumber gerritVersion, GerritVersionChecker.Feature feature) Tells us if we are running the correct version for a particular feature.static booleanisCorrectVersion(GerritVersionNumber gerritVersion, GerritVersionChecker.Feature feature, boolean excludeSnapshotVersions) Tells us if we are running the correct version for a particular feature.
-
Method Details
-
isCorrectVersion
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
Creates a new VersionNumber from the response of the gerrit server.- Parameters:
version- the version as a String.- Returns:
- the version as a versionNumber.
-