com.h3c.util

## Class ComparisonUtils

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

-     public final class ComparisonUtils
      extends Object

  Provides some useful helper methods for compareTo() implementations.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ComparisonUtils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `compareBooleans(boolean mine, boolean other)` Compares the given booleans and returns a value consistent with the requirement for `Comparable.compareTo(T)` such that `false` is sorted before `true`.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ComparisonUtils

          public ComparisonUtils()

  - ### Method Detail

    - #### compareBooleans

          public static int compareBooleans(boolean mine,
                            boolean other)

      Compares the given booleans and returns a value consistent with the requirement for `Comparable.compareTo(T)` such that `false` is sorted before `true`.
      Parameters:
        `mine` - the boolean in my instance
        `other` - the boolean in the other instance
      Returns:
        the result less than, equal to, or greater than 0, as appropriate

Copyright © 2014. All Rights Reserved.