Class Sorters

java.lang.Object
com.blazebit.persistence.view.Sorters

public final class Sorters
extends Object
A utility class that provides methods to create standard sorters.
Since:
1.0.0
Author:
Christian Beikov
  • Method Details

    • sorter

      public static Sorter sorter​(boolean ascending, boolean nullsFirst)
      Creates and returns a new Sorter. The sorter has the following properties
      • sorts ascending if the flag ascending is true, descending otherwise
      • sorts nulls first is the flag nullsFirst is ture, nulls last otherwise
      Parameters:
      ascending - If true sorts ascending, otherwise descending
      nullsFirst - If true sorts nulls first, otherwise nulls last
      Returns:
      A new sorter
    • ascending

      public static Sorter ascending​(boolean nullsFirst)
      Like sorter(boolean, boolean) but with ascending set to true.
      Parameters:
      nullsFirst - If true sorts nulls first, otherwise nulls last
      Returns:
      A new sorter
    • descending

      public static Sorter descending​(boolean nullsFirst)
      Like sorter(boolean, boolean) but with ascending set to false.
      Parameters:
      nullsFirst - If true sorts nulls first, otherwise nulls last
      Returns:
      A new sorter
    • ascending

      public static Sorter ascending()
      Like ascending(boolean) but with nullsFirst set to false.
      Returns:
      A new sorter
    • descending

      public static Sorter descending()
      Like descending(boolean) but with nullsFirst set to false.
      Returns:
      A new sorter