Package com.mongodb.connection
Class ServerVersion
-
- com.mongodb.connection.ServerVersion
-
- All Implemented Interfaces:
<ServerVersion>
public class ServerVersion extends implements <ServerVersion>
Holds an array of three integers representing the server version, e.g. [3, 4, 1].- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description ServerVersion()
Creates a server version which will compare as less than all other valid versionsServerVersion(int majorVersion, int minorVersion)
Constructs a new instance with the given major and minor versions and a patch version of 0.<> versionList)
Constructs a new instance with the given version list of integers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ServerVersion o)
boolean
o)
<>
getVersionList()
Gets the version list.int
hashCode()
toString()
-
-
-
Constructor Detail
-
ServerVersion
public ServerVersion()
Creates a server version which will compare as less than all other valid versions
-
ServerVersion
public ServerVersion(<> versionList)
Constructs a new instance with the given version list of integers.- Parameters:
versionList
- a non-null, three-item list of integers
-
ServerVersion
public ServerVersion(int majorVersion, int minorVersion)
Constructs a new instance with the given major and minor versions and a patch version of 0.- Parameters:
majorVersion
- the major versionminorVersion
- the minor version
-
-
Method Detail
-
getVersionList
public <> getVersionList()
Gets the version list.- Returns:
- an unmodifiable list of three integers
-
compareTo
public int compareTo(ServerVersion o)
- Specified by:
in interface
<ServerVersion>
-
equals
public boolean equals( o)
- Overrides:
in class
-
hashCode
public int hashCode()
- Overrides:
in class
-
toString
public toString()
- Overrides:
in class
-
-