Enum Class NullPlacement

java.lang.Object
java.lang.Enum<NullPlacement>
com.darkcollective.relix.ast.NullPlacement
All Implemented Interfaces:
Serializable, Comparable<NullPlacement>, Constable

public enum NullPlacement extends Enum<NullPlacement>
Where NULL values land when a column is used as a sort key.

NULLS_FIRST places every NULL before any non-NULL value; NULLS_LAST places them after. A sort key holds the placement in the output, whichever way the key runs (SortSpecification.nulls()). Relix's default treats NULL as the largest value, as PostgreSQL and Oracle do: NULLS_LAST ascending and NULLS_FIRST descending (SortSpecification.defaultNulls(com.darkcollective.relix.ast.SortDirection)). SQL's NULLS FIRST and NULLS LAST choose. SortSpecification.nullPlacement() gives the same placement as it reads before a descending key is reversed.

  • Enum Constant Details

    • NULLS_FIRST

      public static final NullPlacement NULLS_FIRST
      NULL values sort before all non-NULL values.
    • NULLS_LAST

      public static final NullPlacement NULLS_LAST
      NULL values sort after all non-NULL values.
  • Method Details

    • values

      public static NullPlacement[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static NullPlacement valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null