Package opennlp.tools.util
Class Version
java.lang.Object
opennlp.tools.util.Version
The
Version class represents the OpenNlp Tools library version.
The version has three parts:
- Major: OpenNlp Tools libraries with a different major version are not interchangeable.
- Minor: OpenNlp Tools libraries with an identical major version, but different minor version may be interchangeable. See release notes for further details.
- Revision: OpenNlp Tools libraries with same major and minor version, but a different revision, are fully interchangeable.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic VersionRetrieves the current version of the OpenNlp Tools library.booleanintgetMajor()Retrieves the major version.intgetMinor()Retrieves the minor version.intRetrieves the revision version.inthashCode()booleanstatic VersiontoString()Retrieves the version string.
-
Field Details
-
DEV_VERSION
-
-
Constructor Details
-
Version
public Version(int major, int minor, int revision, boolean snapshot) Initializes the current instance with the provided versions.- Parameters:
major-minor-revision-snapshot-
-
Version
public Version(int major, int minor, int revision) Initializes the current instance with the provided versions. The version will not be a snapshot version.- Parameters:
major-minor-revision-
-
-
Method Details
-
getMajor
public int getMajor()Retrieves the major version.- Returns:
- major version
-
getMinor
public int getMinor()Retrieves the minor version.- Returns:
- minor version
-
getRevision
public int getRevision()Retrieves the revision version.- Returns:
- revision version
-
isSnapshot
public boolean isSnapshot() -
toString
Retrieves the version string. Theparse(String)method can create an instance ofVersionwith the returned version value string. -
hashCode
public int hashCode() -
equals
-
parse
- Parameters:
version- the string to be parsed- Returns:
- the version represented by the string value
- Throws:
NumberFormatException- if the string does not contain a valid version
-
currentVersion
Retrieves the current version of the OpenNlp Tools library.- Returns:
- the current version
-