ComparableUtils.ComparableCheckBuilder

public static class org.apache.commons.lang3.compare.ComparableUtils.ComparableCheckBuilder<A extends Comparable<A>>[source]

Compares objects of a given generic type A.

Parameters:

<A> – The type of objects that this object may be compared against.

Methods

between(Comparable, Comparable)

Tests if [b <= a <= c] or [b >= a >= c] where the a is object passed to #is.

betweenExclusive(Comparable, Comparable)

Tests if (b < a < c) or (b > a > c) where the a is object passed to #is.

equalTo(Comparable)

Tests if the object passed to #is is equal to b

greaterThan(Comparable)

Tests if the object passed to #is is greater than b

greaterThanOrEqualTo(Comparable)

Tests if the object passed to #is is greater than or equal to b

lessThan(Comparable)

Tests if the object passed to #is is less than b

lessThanOrEqualTo(Comparable)

Tests if the object passed to #is is less than or equal to b

public boolean between(A b, A c)[source]

Tests if [b <= a <= c] or [b >= a >= c] where the a is object passed to #is.

Parameters:
  • b – The object to compare to the base object

  • c – The object to compare to the base object

Returns:

true if the base object is between b and c

public boolean betweenExclusive(A b, A c)[source]

Tests if (b < a < c) or (b > a > c) where the a is object passed to #is.

Parameters:
  • b – The object to compare to the base object

  • c – The object to compare to the base object

Returns:

true if the base object is between b and c and not equal to those

public boolean equalTo(A b)[source]

Tests if the object passed to #is is equal to b

Parameters:

b – The object to compare to the base object

Returns:

true if the value returned by Comparable#compareTo is equal to 0

public boolean greaterThan(A b)[source]

Tests if the object passed to #is is greater than b

Parameters:

b – The object to compare to the base object

Returns:

true if the value returned by Comparable#compareTo is greater than 0

public boolean greaterThanOrEqualTo(A b)[source]

Tests if the object passed to #is is greater than or equal to b

Parameters:

b – The object to compare to the base object

Returns:

true if the value returned by Comparable#compareTo is greater than or equal to 0

public boolean lessThan(A b)[source]

Tests if the object passed to #is is less than b

Parameters:

b – The object to compare to the base object

Returns:

true if the value returned by Comparable#compareTo is less than 0

public boolean lessThanOrEqualTo(A b)[source]

Tests if the object passed to #is is less than or equal to b

Parameters:

b – The object to compare to the base object

Returns:

true if the value returned by Comparable#compareTo is less than or equal to 0