Version
Date: 2016-12-03

com.fasterxml.jackson.core

## Class Version

- java.lang.Object
- - com.fasterxml.jackson.core.Version

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Version>

      public class Version
      extends java.lang.Object
      implements java.lang.Comparable<Version>, java.io.Serializable

  Object that encapsulates versioning information of a component. Version information includes not just version number but also optionally group and artifact ids of the component being versioned.

  Note that optional group and artifact id properties are new with Jackson 2.0: if provided, they should align with Maven artifact information.

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `_artifactId`
    `protected java.lang.String` | `_groupId`
    `protected int` | `_majorVersion`
    `protected int` | `_minorVersion`
    `protected int` | `_patchLevel`
    `protected java.lang.String` | `_snapshotInfo` Additional information for snapshot versions; null for non-snapshot (release) versions.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Version(int major, int minor, int patchLevel, java.lang.String snapshotInfo)` Deprecated. Use variant that takes group and artifact ids
    `Version(int major, int minor, int patchLevel, java.lang.String snapshotInfo, java.lang.String groupId, java.lang.String artifactId)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(Version other)`
    `boolean` | `equals(java.lang.Object o)`
    `java.lang.String` | `getArtifactId()`
    `java.lang.String` | `getGroupId()`
    `int` | `getMajorVersion()`
    `int` | `getMinorVersion()`
    `int` | `getPatchLevel()`
    `int` | `hashCode()`
    `boolean` | `isSnapshot()`
    `boolean` | `isUknownVersion()` Deprecated. Since 2.7 use correctly spelled method `isUnknownVersion()`
    `boolean` | `isUnknownVersion()`
    `java.lang.String` | `toFullString()`
    `java.lang.String` | `toString()`
    `static Version` | `unknownVersion()` Method returns canonical "not known" version, which is used as version in cases where actual version information is not known (instead of null).

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### _majorVersion

          protected final int _majorVersion

    - #### _minorVersion

          protected final int _minorVersion

    - #### _patchLevel

          protected final int _patchLevel

    - #### _groupId

          protected final java.lang.String _groupId

    - #### _artifactId

          protected final java.lang.String _artifactId

    - #### _snapshotInfo

          protected final java.lang.String _snapshotInfo

      Additional information for snapshot versions; null for non-snapshot (release) versions.

  - ### Constructor Detail

    - #### Version

          @Deprecated
          public Version(int major,
                            int minor,
                            int patchLevel,
                            java.lang.String snapshotInfo)

      Deprecated. Use variant that takes group and artifact ids
      Since:
        2.1

    - #### Version

          public Version(int major,
                 int minor,
                 int patchLevel,
                 java.lang.String snapshotInfo,
                 java.lang.String groupId,
                 java.lang.String artifactId)

  - ### Method Detail

    - #### unknownVersion

          public static Version unknownVersion()

      Method returns canonical "not known" version, which is used as version in cases where actual version information is not known (instead of null).

    - #### isUnknownVersion

          public boolean isUnknownVersion()

      Since:
        2.7 to replace misspelled `isUknownVersion()`

    - #### isSnapshot

          public boolean isSnapshot()

    - #### isUknownVersion

          @Deprecated
          public boolean isUknownVersion()

      Deprecated. Since 2.7 use correctly spelled method `isUnknownVersion()`

    - #### getMajorVersion

          public int getMajorVersion()

    - #### getMinorVersion

          public int getMinorVersion()

    - #### getPatchLevel

          public int getPatchLevel()

    - #### getGroupId

          public java.lang.String getGroupId()

    - #### getArtifactId

          public java.lang.String getArtifactId()

    - #### toFullString

          public java.lang.String toFullString()

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### compareTo

          public int compareTo(Version other)

      Specified by:
        `compareTo` in interface `java.lang.Comparable<Version>`