Class ComparableExtensions

java.lang.Object
org.eclipse.xtext.xbase.lib.ComparableExtensions

@GwtCompatible public class ComparableExtensions extends Object
This is an extension library for comparables.
Author:
Sven Efftinge - Initial contribution and API
  • Constructor Details

    • ComparableExtensions

      public ComparableExtensions()
  • Method Details

    • operator_lessThan

      @Pure public static <C> boolean operator_lessThan(Comparable<? super C> left, C right)
      The comparison operator less than.
      Parameters:
      left - a comparable
      right - the value to compare with
      Returns:
      left.compareTo(right) < 0
    • operator_greaterThan

      @Pure public static <C> boolean operator_greaterThan(Comparable<? super C> left, C right)
      The comparison operator greater than.
      Parameters:
      left - a comparable
      right - the value to compare with
      Returns:
      left.compareTo(right) > 0
    • operator_lessEqualsThan

      @Pure public static <C> boolean operator_lessEqualsThan(Comparable<? super C> left, C right)
      The comparison operator less than or equals.
      Parameters:
      left - a comparable
      right - the value to compare with
      Returns:
      left.compareTo(right) <= 0
    • operator_greaterEqualsThan

      @Pure public static <C> boolean operator_greaterEqualsThan(Comparable<? super C> left, C right)
      The comparison operator greater than or equals.
      Parameters:
      left - a comparable
      right - the value to compare with
      Returns:
      left.compareTo(right) >= 0
    • operator_spaceship

      @Pure public static <C> int operator_spaceship(Comparable<? super C> left, C right)
      The spaceship operator <=>.
      Parameters:
      left - a comparable
      right - the value to compare with
      Returns:
      left.compareTo(right)
      Since:
      2.4