Class SolrVersion

  • All Implemented Interfaces:
    Comparable<SolrVersion>

    public final class SolrVersion
    extends Object
    implements Comparable<SolrVersion>
    Simple Solr version representation backed by a Semantic Versioning library. Provides a constant for current Solr version as well as methods to parse string versions and compare versions to each other.
    • Field Detail

      • LATEST

        public static final SolrVersion LATEST
        This instance represents the current (latest) version of Solr.
    • Method Detail

      • valueOf

        public static SolrVersion valueOf​(String version)
        Create a SolrVersion instance from string value. The string must comply to the SemVer spec
      • forIntegers

        public static SolrVersion forIntegers​(int major,
                                              int minor,
                                              int patch)
        Create a SolrVersion instance from set of integer values. Must comply to the SemVer spec
      • toString

        public String toString()
        Return version as plain SemVer string, e.g. "9.0.1"
        Overrides:
        toString in class Object
      • greaterThan

        public boolean greaterThan​(SolrVersion other)
      • greaterThanOrEqualTo

        public boolean greaterThanOrEqualTo​(SolrVersion other)
      • lessThan

        public boolean lessThan​(SolrVersion other)
      • lessThanOrEqualTo

        public boolean lessThanOrEqualTo​(SolrVersion other)
      • getMajorVersion

        public int getMajorVersion()
      • getMinorVersion

        public int getMinorVersion()
      • getPatchVersion

        public int getPatchVersion()
      • getPrereleaseVersion

        public String getPrereleaseVersion()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object