com.h3c.util.version

## Class ReleaseVersion

- java.lang.Object
- - com.h3c.util.version.ReleaseVersion

- All Implemented Interfaces:
    Comparable<ReleaseVersion>

      public class ReleaseVersion
      extends Object
      implements Comparable<ReleaseVersion>

  Instances of this class represent a release version of the form "`[Major].[Minor].[Patch]`".

  Instances are immutable, which makes them thread-safe. The `equals()` and `hashCode()` methods have been overridden so that this class will play nicely with the Collection framework (e.g. using instances as keys in maps). This class implements the `Comparable` interface so instances sort correctly.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(ReleaseVersion o)`
    `boolean` | `equals(Object o)`
    `int` | `getMajor()` Returns the major component of the build version.
    `int` | `getMinor()` Returns the minor component of the build version.
    `int` | `getPatch()` Returns the patch component of the build version.
    `int` | `hashCode()`
    `String` | `toShortString()` Returns the release version as a string without the leading zero for the Major number.
    `String` | `toString()`
    `static ReleaseVersion` | `valueOf(BuildVersion bv)` Returns a release version wrapping the given build version.

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

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

- - ### Method Detail

    - #### getMajor

          public int getMajor()

      Returns the major component of the build version.
      Returns:
        the major component

    - #### getMinor

          public int getMinor()

      Returns the minor component of the build version.
      Returns:
        the minor component

    - #### getPatch

          public int getPatch()

      Returns the patch component of the build version.
      Returns:
        the patch component

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toShortString

          public String toShortString()

      Returns the release version as a string without the leading zero for the Major number.
      Returns:
        the non-leading zero version of the string

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### compareTo

          public int compareTo(ReleaseVersion o)

      Specified by:
        `compareTo` in interface `Comparable<ReleaseVersion>`

    - #### valueOf

          public static ReleaseVersion valueOf(BuildVersion bv)

      Returns a release version wrapping the given build version.
      Parameters:
        `bv` - the build version
      Returns:
        the release version

Copyright © 2014. All Rights Reserved.