sort

fun sort(block: SortDsl.() -> Unit): List<Sort>

Sorts a list of Sort objects based on the provided DSL block.

This function creates an instance of SortDsl, applies the provided DSL block to it, and then builds and returns a list of Sort objects. The DSL allows for specifying fields and their sort directions (ascending or descending).

Return

A list of Sort objects representing the specified sorting criteria.

Parameters

block

A lambda with receiver of type SortDsl that defines the sorting criteria.