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 boolean gt​(T other)
      Whether this value is greater than other value.
      default boolean gte​(T other)
      Whether this value is greater than or equal to other value.
      default boolean lt​(T other)
      Whether this value is less than other value.
      default boolean lte​(T other)
      Whether this value is less than or equal to other value.
      default T max​(T other)
      The maximum value between this or the other value.
      default T min​(T other)
      The minimum value between this or the other value.
      • Methods inherited from interface java.lang.Comparable

        compareTo
    • Method Detail

      • gt

        default boolean gt​(T other)
        Whether this value is greater than other value.
        Parameters:
        other - The other value to compare against
        Returns:
        True if this value is greater than other value
      • gte

        default boolean gte​(T other)
        Whether this value is greater than or equal to other value.
        Parameters:
        other - The other value to compare against
        Returns:
        True if this value is greater than or equal to other value
      • lt

        default boolean lt​(T other)
        Whether this value is less than other value.
        Parameters:
        other - The other value to compare against
        Returns:
        True if this value is less than other value
      • lte

        default boolean lte​(T other)
        Whether this value is less than or equal to other value.
        Parameters:
        other - The other value to compare against
        Returns:
        True if this value is less than or equal to other value
      • min

        default T min​(T other)
        The minimum value between this or the other value.
        Parameters:
        other - The other value to compare against
        Returns:
        Will return this value if less than or equal to the other value, otherwise will return other.
      • max

        default T max​(T other)
        The maximum value between this or the other value.
        Parameters:
        other - The other value to compare against
        Returns:
        Will return this value if greater than or equal to the other value, otherwise will return other.