Interface ElementLocation

All Known Subinterfaces:
LocationInList, UnassignedLocation

public sealed interface ElementLocation permits LocationInList, UnassignedLocation
A supertype for LocationInList and UnassignedLocation.

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 UnassignedLocation to represent this null value, and user code must explicitly decide how to handle this case. This prevents accidental use of UnassignedLocation in places where LocationInList 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.