public enum Comparison extends java.lang.Enum<Comparison>
Modifier and Type | Method and Description |
---|---|
static <T extends java.lang.Comparable<T>> |
compare(T a,
T b)
Returns a Comparison result from the two given comparables.
|
static Comparison |
from(int compareToResult)
Returns a Comparison from the given result of Comparable.compareTo().
|
<T> T |
lesserEqualGreater(T lesser,
T equal,
T greater)
Returns the appropriate T based on the Comparison value.
|
static Comparison |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Comparison[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Comparison LESSER
public static final Comparison EQUAL
public static final Comparison GREATER
public static Comparison[] values()
for (Comparison c : Comparison.values()) System.out.println(c);
public static Comparison valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic <T> T lesserEqualGreater(T lesser, T equal, T greater)
public static <T extends java.lang.Comparable<T>> Comparison compare(T a, T b)
public static Comparison from(int compareToResult)