Class Version


  • public class Version
    extends java.lang.Object
    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.
    • Constructor Summary

      Constructors 
      Constructor Description
      Version​(int major, int minor, int revision)
      Initializes the current instance with the provided versions.
      Version​(int major, int minor, int revision, boolean snapshot)
      Initializes the current instance with the provided versions.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Version currentVersion()
      Retrieves the current version of the OpenNlp Tools library.
      boolean equals​(java.lang.Object o)  
      int getMajor()
      Retrieves the major version.
      int getMinor()
      Retrieves the minor version.
      int getRevision()
      Retrieves the revision version.
      boolean isSnapshot()  
      static Version parse​(java.lang.String version)
      Return a new Version initialized to the value represented by the specified String
      java.lang.String toString()
      Retrieves the version string.
      • Methods inherited from class java.lang.Object

        getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DEV_VERSION

        public static final Version DEV_VERSION
    • Constructor Detail

      • 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 Detail

      • 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

        public java.lang.String toString()
        Retrieves the version string. The parse(String) method can create an instance of Version with the returned version value string.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the version value string
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • parse

        public static Version parse​(java.lang.String version)
        Return a new Version initialized to the value represented by the specified String
        Parameters:
        version - the string to be parsed
        Returns:
        the version represented by the string value
        Throws:
        java.lang.NumberFormatException - if the string does not contain a valid version
      • currentVersion

        public static Version currentVersion()
        Retrieves the current version of the OpenNlp Tools library.
        Returns:
        the current version