Comparable#compareTo results to booleans.
Example: boolean x = ComparableUtils.is(myComparable).lessThanOrEqualTo(otherComparable)
#ThreadSafe#
| Modifier and Type | Class and Description |
|---|---|
| public static class | ComparableUtils.
the type of objects that this object may be compared against. A extends ComparableCompares objects of a given generic type |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static < type of the test object A extends Comparable | Returns: a predicate for true if the tested object is between b and cthe object to compare to the tested object b, final A the object to compare to the tested object c)Creates a predicate to test if |
| public static < type of the test object A extends Comparable | Returns: a predicate for true if the tested object is between b and c and not equal to thosethe object to compare to the tested object b, final A the object to compare to the tested object c)Creates a predicate to test if |
| public static < type of the test object A extends Comparable | Returns: a predicate for true if the value returned byComparable#compareTo
is greater than or equal to 0the object to compare to the tested object b)Creates a predicate to test if the tested object is greater than or equal to |
| public static < type of the test object A extends Comparable | gt(final A
the object to compare to the tested object b)Creates a predicate to test if the tested object is greater than |
| public static < type of the base object A extends Comparable | Returns: a builder object with further methodsbase object in the further comparison a)Creates a new |
| public static < type of the test object A extends Comparable | Returns: a predicate for true if the value returned byComparable#compareTo
is less than or equal to 0the object to compare to the tested object b)Creates a predicate to test if the tested object is less than or equal to |
| public static < type of the test object A extends Comparable | lt(final A
the object to compare to the tested object b)Creates a predicate to test if the tested object is less than |
| public static < Type of what we are comparing. A extends Comparable | Returns: the largest ofcomparable1 and comparable2.the first comparable, may be null. comparable1, final A the second comparable, may be null. comparable2)Returns the greater of two |
| public static < Type of what we are comparing. A extends Comparable | Returns: the smallest ofcomparable1 and comparable2.the first comparable, may be null. comparable1, final A the second comparable, may be null. comparable2)Returns the lesser of two |
| ComparableUtils | back to summary |
|---|---|
| private ComparableUtils() | |
| between | back to summary |
|---|---|
| public static <A extends Comparable Creates a predicate to test if
| |
| betweenExclusive | back to summary |
|---|---|
| public static <A extends Comparable Creates a predicate to test if
| |
| ge | back to summary |
|---|---|
| public static <A extends Comparable Creates a predicate to test if the tested object is greater than or equal to
| |
| gt | back to summary |
|---|---|
| public static <A extends Comparable Creates a predicate to test if the tested object is greater than
| |
| is | back to summary |
|---|---|
| public static <A extends Comparable Creates a new
| |
| le | back to summary |
|---|---|
| public static <A extends Comparable Creates a predicate to test if the tested object is less than or equal to
| |
| lt | back to summary |
|---|---|
| public static <A extends Comparable Creates a predicate to test if the tested object is less than
| |
| max | back to summary |
|---|---|
| public static <A extends Comparable Returns the greater of two
For three or more values, use
| |
| min | back to summary |
|---|---|
| public static <A extends Comparable Returns the lesser of two
For three or more values, use
| |
A.
| Modifier and Type | Field and Description |
|---|---|
| private final A |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public boolean | Returns: true if the base object is between b and c and not equal to thosethe object to compare to the base object b, final A the object to compare to the base object c)Tests if |
| private boolean | |
| private boolean | |
| public boolean | |
| public boolean | greaterThan(final A
the object to compare to the base object b)Tests if the object passed to |
| public boolean | greaterThanOrEqualTo(final A
the object to compare to the base object b)Tests if the object passed to |
| public boolean | |
| public boolean | lessThanOrEqualTo(final A
the object to compare to the base object b)Tests if the object passed to |
| a | back to summary |
|---|---|
| private final A a | |
| ComparableCheckBuilder | back to summary |
|---|---|
| private ComparableCheckBuilder(final A a) | |
| between | back to summary |
|---|---|
| public boolean between(final A b, final A c) Tests if
| |
| betweenExclusive | back to summary |
|---|---|
| public boolean betweenExclusive(final A b, final A c) Tests if
| |
| betweenOrdered | back to summary |
|---|---|
| private boolean betweenOrdered(final A b, final A c) | |
| betweenOrderedExclusive | back to summary |
|---|---|
| private boolean betweenOrderedExclusive(final A b, final A c) | |
| equalTo | back to summary |
|---|---|
| public boolean equalTo(final A b) Tests if the object passed to
| |
| greaterThan | back to summary |
|---|---|
| public boolean greaterThan(final A b) Tests if the object passed to
| |
| greaterThanOrEqualTo | back to summary |
|---|---|
| public boolean greaterThanOrEqualTo(final A b) Tests if the object passed to
| |
| lessThan | back to summary |
|---|---|
| public boolean lessThan(final A b) Tests if the object passed to
| |
| lessThanOrEqualTo | back to summary |
|---|---|
| public boolean lessThanOrEqualTo(final A b) Tests if the object passed to
| |