Package opennlp.tools.util
Class Version
- java.lang.Object
-
- opennlp.tools.util.Version
-
public class Version extends Object
TheVersion
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 Modifier and Type Field Description static Version
DEV_VERSION
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Version
currentVersion()
boolean
equals(Object obj)
int
getMajor()
int
getMinor()
int
getRevision()
int
hashCode()
boolean
isSnapshot()
static Version
parse(String version)
String
toString()
Theparse(String)
method can create an instance ofVersion
with the returned version value string.
-
-
-
Field Detail
-
DEV_VERSION
public static final Version DEV_VERSION
-
-
Constructor Detail
-
Version
public Version(int major, int minor, int revision, boolean snapshot)
Initializes aVersion
instance with the provided version elements.- Parameters:
major
- Must not be negative.minor
- Must not be negative.revision
- Must not be negative.snapshot
-true
if the version represents a snapshot,false
otherwise.
-
-
Method Detail
-
getMajor
public int getMajor()
- Returns:
- Retrieves the major version, guaranteed to be non-negative.
-
getMinor
public int getMinor()
- Returns:
- Retrieves the minor version, guaranteed to be non-negative.
-
getRevision
public int getRevision()
- Returns:
- Retrieves the revision version, guaranteed to be non-negative.
-
isSnapshot
public boolean isSnapshot()
-
toString
public String toString()
Theparse(String)
method can create an instance ofVersion
with the returned version value string.
-
parse
public static Version parse(String version)
- Parameters:
version
- The string to be parsed- Returns:
- The version represented by the string value
- Throws:
NumberFormatException
- Thrown ifversion
does not adhere to a valid form.
-
currentVersion
public static Version currentVersion()
- Returns:
- Retrieves the current version of the OpenNLP Tools library.
-
-