Interface ElementPosition

All Known Subinterfaces:
PositionInList, UnassignedElement

@NullMarked public sealed interface ElementPosition permits PositionInList, UnassignedElement
A supertype for PositionInList and UnassignedElement.

PlanningListVariable.allowsUnassignedValues() allows for a value to not be part of any entity's list. This introduces null into user code, and makes it harder to reason about the code. Therefore, we introduce UnassignedElement to represent this null value, and user code must explicitly decide how to handle this case. This prevents accidental use of UnassignedElement in places where PositionInList is expected, catching this error as early as possible.

This package and all of its contents are part of the Move Streams API, which is under development and is only offered as a preview feature. There are no guarantees for backward compatibility; any class, method, or field may change or be removed without prior notice, although we will strive to avoid this as much as possible.

We encourage you to try the API and give us feedback on your experience with it, before we finalize the API. Please direct your feedback to Timefold Solver Github.