Class SortDirective


  • public final class SortDirective
    extends java.lang.Object
    The sorting definition for a DFDataTree. The sorting definition is based on a list of fields with their designated ordering. The ordering is defined as a boolean flag; true means the ascending order and false means the descending order. Each pair of a DFField and the ordering flag is represented as a SortDirective.Item.

    Instances of this class are immutable.

    Author:
    Petr Hamernik
    • Field Detail

      • SQL_ASC

        public static final java.lang.String SQL_ASC
        Constant for ascending sort order when determining default SortDirective for an entity.
        See Also:
        Constant Field Values
      • SQL_DESC

        public static final java.lang.String SQL_DESC
        Constant for descending sort order when determining default SortDirective for an entity.
        See Also:
        Constant Field Values
      • EMPTY

        public static final SortDirective EMPTY
        An empty SortDirective.
    • Method Detail

      • removeFields

        public static SortDirective removeFields​(SortDirective sort,
                                                 java.lang.Iterable<? extends DFField> fields)
        Removes fields from SortDirective. The new SortDirective is identical with sort, but its items no longer contain those for fields.
        Parameters:
        sort - The SortDirective to remove fields from.
        fields - The field to remove.
        Returns:
        A new SortDirective instance identical to sort, but with its items filtered by fields parameter.
      • getFields

        public java.util.List<DFField> getFields()
        Gets all fields used in this SortDirective.
        Returns:
        An immutable list of DFField instances.
      • getSorts

        public java.util.List<SortDirective.Item> getSorts()
        Gets all items used in this SortDirective.
        Returns:
        An immutable list of SortDirective.Items instances.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object