com.sonyericsson.hudson.plugins.gerrit.trigger.version
Class GerritVersionChecker

java.lang.Object
  extended by 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
static class GerritVersionChecker.Feature
          The feature version we want to compare the current Gerrit version with.
 
Method Summary
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(GerritVersionNumber gerritVersion, GerritVersionChecker.Feature feature)
          Tells us if we are running the correct version for a particular feature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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(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.


Copyright © 2004-2013. All Rights Reserved.