com.h3c.util

## Class Version

- java.lang.Object
- - com.h3c.util.Version

- All Implemented Interfaces:
    Comparable<Version>

      public class Version
      extends Object
      implements Comparable<Version>

  Version class is used to abstract a version string that can be compared.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Version()` Constructor.
    `Version(String value)` Constructor.
    `Version(String value, String splitDelim)` Constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(Version o)` Implement the comparable interface so the the extended device classes will be sorted by version (low to high).
    `boolean` | `equals(Object o)`
    `int` | `hashCode()`
    `boolean` | `isGreater(Version targetVersion)` Returns true if this version is greater than the passed in version.
    `boolean` | `isGreaterOrEqual(Version targetVersion)` Returns true if this version is greater than or equal the passed in version.
    `boolean` | `isLess(Version targetVersion)` Returns true if this version is less than the passed in version.
    `boolean` | `isLessOrEqual(Version targetVersion)` Returns true if this version is less than or equal the passed in version.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### Version

          public Version()

      Constructor.

    - #### Version

          public Version(String value)

      Constructor.
      Parameters:
        `value` - version string

    - #### Version

          public Version(String value,
                 String splitDelim)

      Constructor.
      Parameters:
        `value` - version string
        `splitDelim` - regular expression delimiter; see `String.split(String)`

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### isGreater

          public boolean isGreater(Version targetVersion)

      Returns true if this version is greater than the passed in version.
      Parameters:
        `targetVersion` - version in object form
      Returns:
        true if the version of this instance is greater then the passed in version

    - #### isGreaterOrEqual

          public boolean isGreaterOrEqual(Version targetVersion)

      Returns true if this version is greater than or equal the passed in version.
      Parameters:
        `targetVersion` - version in object form
      Returns:
        true if the version of this instance is greater then or equal the passed in version

    - #### isLess

          public boolean isLess(Version targetVersion)

      Returns true if this version is less than the passed in version.
      Parameters:
        `targetVersion` - version in object form
      Returns:
        true if the version of this instance is less then the passed in version

    - #### isLessOrEqual

          public boolean isLessOrEqual(Version targetVersion)

      Returns true if this version is less than or equal the passed in version.
      Parameters:
        `targetVersion` - version in object form
      Returns:
        true if the version of this instance is less then or equal the passed in version

    - #### compareTo

          public int compareTo(Version o)

      Implement the comparable interface so the the extended device classes will be sorted by version (low to high).
      Specified by:
        `compareTo` in interface `Comparable<Version>`
      Parameters:
        `o` - the object to be compared.
      Returns:
        < 0 if this is less then o; 0 if this is equal to o; > 0 if this is greater than o

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2014. All Rights Reserved.