Enum NullCollation

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<NullCollation>

    public enum NullCollation
    extends java.lang.Enum<NullCollation>
    Strategy for how NULL values are to be sorted if NULLS FIRST or NULLS LAST are not specified in an item in the ORDER BY clause.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      FIRST
      Nulls first for DESC and ASC.
      HIGH
      Nulls first for DESC, nulls last for ASC.
      LAST
      Nulls last for DESC and ASC.
      LOW
      Nulls last for DESC, nulls first for ASC.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private NullCollation()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isDefaultOrder​(boolean nullsFirst, boolean desc)
      Returns whether a given combination of null direction and sort order is the default order of nulls returned in the ORDER BY clause.
      boolean last​(boolean desc)
      Returns whether NULL values should appear last.
      static NullCollation valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static NullCollation[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • HIGH

        public static final NullCollation HIGH
        Nulls first for DESC, nulls last for ASC.
      • LOW

        public static final NullCollation LOW
        Nulls last for DESC, nulls first for ASC.
      • FIRST

        public static final NullCollation FIRST
        Nulls first for DESC and ASC.
      • LAST

        public static final NullCollation LAST
        Nulls last for DESC and ASC.
    • Constructor Detail

      • NullCollation

        private NullCollation()
    • Method Detail

      • values

        public static NullCollation[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (NullCollation c : NullCollation.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static NullCollation valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • last

        public boolean last​(boolean desc)
        Returns whether NULL values should appear last.
        Parameters:
        desc - Whether sort is descending
      • isDefaultOrder

        public boolean isDefaultOrder​(boolean nullsFirst,
                                      boolean desc)
        Returns whether a given combination of null direction and sort order is the default order of nulls returned in the ORDER BY clause.