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 Details

    • solutionMetaModel

      PlanningSolutionMetaModel<Solution_> solutionMetaModel()
      Describes the PlanningSolution class.
    • entityDiff

      <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.
      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

      <Entity_> Set<PlanningEntityDiff<Solution_,Entity_>> entityDiffs(Class<Entity_> entityClass)
      As defined by entityDiffs(), but only for entities of the given class.
      Parameters:
      entityClass - Entity class to filter on.
    • removedEntities

      Set<Object> removedEntities()
      Returns all entities that were present in the old solution, but are not in the new.
    • addedEntities

      Set<Object> 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.