diff --git a/core/src/main/java/ai/timefold/solver/core/api/move/SolutionView.java b/core/src/main/java/ai/timefold/solver/core/api/move/SolutionView.java index 94d5a06c64..a9723d4392 100644 --- a/core/src/main/java/ai/timefold/solver/core/api/move/SolutionView.java +++ b/core/src/main/java/ai/timefold/solver/core/api/move/SolutionView.java @@ -43,11 +43,11 @@ public interface SolutionView { * @param variableMetaModel Describes the variable whose value is to be read. * @param entity The entity whose variable is to be read. * @param index >= 0 - * @return maybe null; the value of the variable on the entity at the index + * @return The value at the given index in the list variable. * @throws NullPointerException if the value of the list variable is null * @throws IndexOutOfBoundsException if the index is out of bounds */ - @Nullable Value_ getValueAtIndex( + @NonNull Value_ getValueAtIndex( @NonNull PlanningListVariableMetaModel variableMetaModel, @NonNull Entity_ entity, int index); diff --git a/core/src/main/java/ai/timefold/solver/core/impl/move/director/MoveDirector.java b/core/src/main/java/ai/timefold/solver/core/impl/move/director/MoveDirector.java index 953fe32309..39ec4bca94 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/move/director/MoveDirector.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/move/director/MoveDirector.java @@ -102,7 +102,7 @@ public final Value_ getValue( @SuppressWarnings("unchecked") @Override - public final Value_ getValueAtIndex( + public final @NonNull Value_ getValueAtIndex( @NonNull PlanningListVariableMetaModel variableMetaModel, @NonNull Entity_ entity, int index) { return (Value_) extractVariableDescriptor(variableMetaModel).getValue(entity).get(index);