withNullAsLeast

Returns an Order context for nullable elements where null is considered the least value.

In the resulting order:

  • Two null values are considered equal

  • A null value is considered less 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 minimum value.

Type Parameters

Element

The non-nullable element type for which to create the nullable order context.


Returns a Comparator for nullable elements where null is considered the least value.

In the resulting comparator:

  • Two null values are considered equal

  • A null value is considered less 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 minimum value.

Type Parameters

Element

The non-nullable element type for which to create the nullable comparator.