Package com.mysql.cj

Class ServerVersion

java.lang.Object
com.mysql.cj.ServerVersion
All Implemented Interfaces:
java.lang.Comparable<ServerVersion>

public class ServerVersion
extends java.lang.Object
implements java.lang.Comparable<ServerVersion>
A server version.
  • Constructor Summary

    Constructors 
    Constructor Description
    ServerVersion​(int major, int minor, int subminor)  
    ServerVersion​(java.lang.String completeVersion, int major, int minor, int subminor)  
  • Method Summary

    Modifier and Type Method Description
    int compareTo​(ServerVersion other)  
    boolean equals​(java.lang.Object obj)  
    int getMajor()  
    int getMinor()  
    int getSubminor()  
    int hashCode()  
    boolean meetsMinimum​(ServerVersion min)
    Does this version meet the minimum specified by `min'?
    static ServerVersion parseVersion​(java.lang.String versionString)
    Parse the server version into major/minor/subminor.
    java.lang.String toString()
    A string representation of this version.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ServerVersion

      public ServerVersion​(java.lang.String completeVersion, int major, int minor, int subminor)
    • ServerVersion

      public ServerVersion​(int major, int minor, int subminor)
  • Method Details

    • getMajor

      public int getMajor()
    • getMinor

      public int getMinor()
    • getSubminor

      public int getSubminor()
    • toString

      public java.lang.String toString()
      A string representation of this version. If this version was parsed from, or provided with, a "complete" string which may contain more than just the version number, this string is returned verbatim. Otherwise, a string representation of the version numbers is given.
      Overrides:
      toString in class java.lang.Object
      Returns:
      string version representation
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • compareTo

      public int compareTo​(ServerVersion other)
      Specified by:
      compareTo in interface java.lang.Comparable<ServerVersion>
    • meetsMinimum

      public boolean meetsMinimum​(ServerVersion min)
      Does this version meet the minimum specified by `min'?
      Parameters:
      min - The minimum version to compare against.
      Returns:
      true if version meets the minimum specified by `min'
    • parseVersion

      public static ServerVersion parseVersion​(java.lang.String versionString)
      Parse the server version into major/minor/subminor.
      Parameters:
      versionString - string version representation
      Returns:
      ServerVersion