com.h3c.util.version

## Class ReleaseCandidate

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

- All Implemented Interfaces:
    Comparable<ReleaseCandidate>

      public class ReleaseCandidate
      extends Object
      implements Comparable<ReleaseCandidate>

  Instances of this class represent a release candidate. The following information is embodied in each instance:
  - candidate number
  - build version
  - date of build
  - flag indicating whether this is the official release

  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(ReleaseCandidate o)`
    `boolean` | `equals(Object o)`
    `Date` | `getBuildDate()` Returns a copy of the date of the build for this release candidate.
    `BuildVersion` | `getBuildVersion()` Returns the build version for this release candidate.
    `int` | `getNumber()` Returns this release candidate number.
    `int` | `hashCode()`
    `boolean` | `isOfficial()` This predicate returns true if this release candidate is the official release.
    `String` | `toString()`
    `static ReleaseCandidate` | `valueOf(int candidateNumber, BuildVersion theBuild, Date buildDate, boolean official)` Returns a ReleaseCandidate instance populated with the given parameters.

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

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

- - ### Method Detail

    - #### getNumber

          public int getNumber()

      Returns this release candidate number.
      Returns:
        the release candidate number

    - #### getBuildVersion

          public BuildVersion getBuildVersion()

      Returns the build version for this release candidate.
      Returns:
        the build version

    - #### getBuildDate

          public Date getBuildDate()

      Returns a copy of the date of the build for this release candidate.
      Returns:
        the build date

    - #### isOfficial

          public boolean isOfficial()

      This predicate returns true if this release candidate is the official release.
      Returns:
        true for the official release

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### compareTo

          public int compareTo(ReleaseCandidate o)

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

    - #### valueOf

          public static ReleaseCandidate valueOf(int candidateNumber,
                                 BuildVersion theBuild,
                                 Date buildDate,
                                 boolean official)

      Returns a ReleaseCandidate instance populated with the given parameters.
      Parameters:
        `candidateNumber` - the release candidate number
        `theBuild` - the build version for this candidate
        `buildDate` - the date of the build
        `official` - whether this candidate is the official release
      Returns:
        the release candidate instance

Copyright © 2014. All Rights Reserved.