Package com.fizzed.crux.util
Interface MoreComparable<T>
-
- Type Parameters:
T-
- All Superinterfaces:
java.lang.Comparable<T>
- All Known Implementing Classes:
TimeDuration
public interface MoreComparable<T> extends java.lang.Comparable<T>Extends a Comparable to provide greater than and less than methods.- Author:
- jjlauer
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default booleangt(T other)Whetherthisvalue is greater thanothervalue.default booleangte(T other)Whetherthisvalue is greater than or equal toothervalue.default booleanlt(T other)Whetherthisvalue is less thanothervalue.default booleanlte(T other)Whetherthisvalue is less than or equal toothervalue.default Tmax(T other)The maximum value betweenthisor the other value.default Tmin(T other)The minimum value betweenthisor the other value.
-
-
-
Method Detail
-
gt
default boolean gt(T other)
Whetherthisvalue is greater thanothervalue.- Parameters:
other- The other value to compare against- Returns:
- True if
thisvalue is greater thanothervalue
-
gte
default boolean gte(T other)
Whetherthisvalue is greater than or equal toothervalue.- Parameters:
other- The other value to compare against- Returns:
- True if
thisvalue is greater than or equal toothervalue
-
lt
default boolean lt(T other)
Whetherthisvalue is less thanothervalue.- Parameters:
other- The other value to compare against- Returns:
- True if
thisvalue is less thanothervalue
-
lte
default boolean lte(T other)
Whetherthisvalue is less than or equal toothervalue.- Parameters:
other- The other value to compare against- Returns:
- True if
thisvalue is less than or equal toothervalue
-
min
default T min(T other)
The minimum value betweenthisor the other value.- Parameters:
other- The other value to compare against- Returns:
- Will return
thisvalue if less than or equal to theothervalue, otherwise will returnother.
-
-