Interface PlanningSolutionDiff<Solution_>
- Type Parameters:
Solution_-
@NullMarked
public interface PlanningSolutionDiff<Solution_>
A diff between two instances of a
PlanningSolution.
Obtain using SolutionManager.diff(Object, Object).
The first argument to that method is called the "old" solution,
and the second argument is called the "new" solution.
See the Javadoc of SolutionManager.diff(Object, Object) for more information.
This interface is not intended to be implemented by users.
The default implementation has a default toString() method that prints a summary of the differences.
Do not attempt to parse that string - it is subject to change in the future.
-
Method Summary
Modifier and TypeMethodDescriptionReturns all entities that are present in the new solution, but were not in the old.<Entity_> @Nullable PlanningEntityDiff<Solution_,Entity_> entityDiff(Entity_ entity) Returns the diff for the given entity, or null if the entity is not present in the diff.Returns the diffs of all entities that can be found in both the old and new solution, where at least one variable (genuine or shadow) of that entity changed.<Entity_> Set<PlanningEntityDiff<Solution_,Entity_>> entityDiffs(Class<Entity_> entityClass) As defined byentityDiffs(), but only for entities of the given class.Returns the new solution.Returns the old solution.Returns all entities that were present in the old solution, but are not in the new.Describes thePlanningSolutionclass.
-
Method Details
-
solutionMetaModel
PlanningSolutionMetaModel<Solution_> solutionMetaModel()Describes thePlanningSolutionclass. -
entityDiff
Returns the diff for the given entity, or null if the entity is not present in the diff.- Parameters:
entity- Entity to check for.- Returns:
- Null if the entity is not present in the diff (= did not change.)
-
entityDiffs
Set<PlanningEntityDiff<Solution_,?>> entityDiffs()Returns the diffs of all entities that can be found in both the old and new solution, where at least one variable (genuine or shadow) of that entity changed. -
entityDiffs
As defined byentityDiffs(), but only for entities of the given class.- Parameters:
entityClass- Entity class to filter on.
-
removedEntities
Returns all entities that were present in the old solution, but are not in the new. -
addedEntities
Returns all entities that are present in the new solution, but were not in the old. -
oldSolution
Solution_ oldSolution()Returns the old solution. -
newSolution
Solution_ newSolution()Returns the new solution.
-