withNullAsGreatest
Returns an Order context for nullable elements where null is considered the greatest value.
In the resulting order:
Two null values are considered equal
A null value is considered greater than any non-null value
Two non-null values are compared using this order context
Receiver
The order context for non-nullable elements.
Return
An Order instance where null is treated as the maximum value.
Type Parameters
The non-nullable element type for which to create the nullable order context.
Returns a Comparator for nullable elements where null is considered the greatest value.
In the resulting comparator:
Two null values are considered equal
A null value is considered greater than any non-null value
Two non-null values are compared using this comparator
Receiver
The comparator for non-nullable elements.
Return
A Comparator instance where null is treated as the maximum value.
Type Parameters
The non-nullable element type for which to create the nullable comparator.