de.caff.generics.function

## Interface CharOrdering

- All Known Subinterfaces:
    CharOrdering.Serial, IntOrdering, IntOrdering.Serial
  Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

      @FunctionalInterface
      public interface CharOrdering

  Define an order for two primitive char values.

  Compared to a `Comparator<Char>` this can avoid boxing and unboxing in various situations.

  Since:
    January 23, 2023
  Author:
    Rammi

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `CharOrdering.Serial` A char ordering which is serializable.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static CharOrdering` | `ASCENDING` Natural order of ascending `char` values.
    `static CharOrdering` | `DESCENDING` Inverse natural order of `char` values.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default boolean` | `ascending(char v1, char v2)` Are the two values represented in strictly ascending order?
    `default boolean` | `ascendingOrSame(char v1, char v2)` Are the two values represented in ascending order?
    `default java.util.Comparator<java.lang.Character>` | `asCharComparator()` Use this ordering as a comparator.
    `default Ordering<java.lang.Character>` | `asCharOrdering()` Get this ordering as a generic char ordering.
    `Order` | `checkChar(char v1, char v2)` Get the order of the two values.
    `default boolean` | `descending(char v1, char v2)` Are the two values represented in strictly descending order?
    `default boolean` | `descendingOrSame(char v1, char v2)` Are the two values represented in descending order?
    `default boolean` | `different(char v1, char v2)` Are the two values considered different by this order?
    `static CharOrdering` | `fromComparator(java.util.Comparator<java.lang.Character> comparator)` Convert a standard comparator of `Double` into a double ordering.
    `default CharOrdering` | `inverse()` Invert this order.
    `default boolean` | `same(char v1, char v2)` Are the two values considered equal by this order?

- - ### Field Detail

    - #### ASCENDING

          static final CharOrdering ASCENDING

      Natural order of ascending `char` values.

    - #### DESCENDING

          static final CharOrdering DESCENDING

      Inverse natural order of `char` values.

  - ### Method Detail

    - #### checkChar

          @NotNull
          Order checkChar(char v1,
                                   char v2)

      Get the order of the two values.
      Parameters:
        `v1` - first value
        `v2` - second value
      Returns:
        order of the two values

    - #### ascending

          default boolean ascending(char v1,
                                    char v2)

      Are the two values represented in strictly ascending order?
      Parameters:
        `v1` - first value
        `v2` - second value
      Returns:
        `true` if `v1 < v2` according to this ordering
        `false` if `v1 >= v2` according to this ordering
      See Also:
        `descending(char, char)`, `ascendingOrSame(char, char)`, `descendingOrSame(char, char)`, `same(char, char)`, `different(char, char)`

    - #### ascendingOrSame

          default boolean ascendingOrSame(char v1,
                                          char v2)

      Are the two values represented in ascending order?
      Parameters:
        `v1` - first value
        `v2` - second value
      Returns:
        `true` if `v1 <= v2` according to this ordering
        `false` if `v1 > v2` according to this ordering
      See Also:
        `ascending(char, char)`, `descending(char, char)`, `descendingOrSame(char, char)`, `same(char, char)`, `different(char, char)`

    - #### descending

          default boolean descending(char v1,
                                     char v2)

      Are the two values represented in strictly descending order?
      Parameters:
        `v1` - first value
        `v2` - second value
      Returns:
        `true` if `v1 > v2` according to this ordering
        `false` if `v1 <= v2` according to this ordering
      See Also:
        `ascending(char, char)`, `ascendingOrSame(char, char)`, `descendingOrSame(char, char)`, `same(char, char)`, `different(char, char)`

    - #### descendingOrSame

          default boolean descendingOrSame(char v1,
                                           char v2)

      Are the two values represented in descending order?
      Parameters:
        `v1` - first value
        `v2` - second value
      Returns:
        `true` if `v1 >= v2` according to this ordering
        `false` if `v1 < v2` according to this ordering
      See Also:
        `ascending(char, char)`, `descending(char, char)`, `ascendingOrSame(char, char)`, `same(char, char)`, `different(char, char)`

    - #### same

          default boolean same(char v1,
                               char v2)

      Are the two values considered equal by this order?
      Parameters:
        `v1` - first value
        `v2` - second value
      Returns:
        `true` if `v1 == v2` according to this order
        `false` if `v1 != v2` according to this ordering
      See Also:
        `ascending(char, char)`, `descending(char, char)`, `ascendingOrSame(char, char)`, `descendingOrSame(char, char)`, `different(char, char)`

    - #### different

          default boolean different(char v1,
                                    char v2)

      Are the two values considered different by this order?
      Parameters:
        `v1` - first value
        `v2` - second value
      Returns:
        `true` if `v1 != v2` according to this order
        `false` if `v1 == v2` according to this ordering
      See Also:
        `ascending(char, char)`, `descending(char, char)`, `ascendingOrSame(char, char)`, `descendingOrSame(char, char)`, `same(char, char)`

    - #### inverse

          @NotNull
          default CharOrdering inverse()

      Invert this order.
      Returns:
        inverse order

    - #### asCharComparator

          @NotNull
          default java.util.Comparator<java.lang.Character> asCharComparator()

      Use this ordering as a comparator.
      Returns:
        comparator of `Char`

    - #### asCharOrdering

          @NotNull
          default Ordering<java.lang.Character> asCharOrdering()

      Get this ordering as a generic char ordering.
      Returns:
        generic ordering for chars

    - #### fromComparator

          @NotNull
          static CharOrdering fromComparator(@NotNull
                                                      java.util.Comparator<java.lang.Character> comparator)

      Convert a standard comparator of `Double` into a double ordering.
      Parameters:
        `comparator` - comparator of `Double`
      Returns:
        ordering