Class 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>
    • 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.