Package org.mockserver.scim
Class ScimSort
java.lang.Object
org.mockserver.scim.ScimSort
Minimal SCIM 2.0 sort evaluator implementing the
sortBy + sortOrder
query parameters (RFC 7644 §3.4.2.3).
sortByis a (possibly nested, dot-separated) attribute path, e.g.userNameorname.familyName. Comparison is case-insensitive (SCIM string attributes default tocaseExact:false).sortOrderisascending(default) ordescending.- Resources whose sort attribute has no value are always ordered last,
regardless of
sortOrder. - The sort is stable, so resources comparing equal keep their prior (filtered, insertion) order.
A syntactically invalid sortBy path, or a sortOrder other than
ascending/descending, is a loud IllegalArgumentException
(surfaced by the callback as a 400 invalidValue SCIM error) — mirroring
how ScimFilter rejects a malformed filter.
-
Method Details
-
parse
Parses thesortBy/sortOrderquery parameters.- Returns:
- the parsed sort, or
nullifsortByis blank (no sorting requested) - Throws:
IllegalArgumentException- ifsortByis a malformed attribute path, orsortOrderis present but not ascending/descending
-
apply
public List<com.fasterxml.jackson.databind.node.ObjectNode> apply(List<com.fasterxml.jackson.databind.node.ObjectNode> resources) Returns a new list of the supplied resources ordered by this sort. The input list is not mutated. -
getSortBy
-
isDescending
public boolean isDescending()
-