Interface PlanningEntityDiff<Solution_,Entity_>
- Type Parameters:
Solution_-Entity_-
@NullMarked
public interface PlanningEntityDiff<Solution_,Entity_>
A diff between two instances of a
PlanningEntity,
where at least one variable of that entity (genuine or shadow) changed.
Obtain from PlanningSolutionDiff.
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 TypeMethodDescriptionentity()The entity that this diff is of.Describes thePlanningEntityclass.The diff between the two solutions that this is part of.<Value_> PlanningVariableDiff<Solution_,Entity_, Value_> Returns a single diff for the entity's variables.<Value_> @Nullable PlanningVariableDiff<Solution_,Entity_, Value_> variableDiff(String variableName) Returns the diff for the variable with the given name, or null if the variable is not present in the diff.Returns the diffs of all variables of a single changed entity.
-
Method Details
-
solutionDiff
PlanningSolutionDiff<Solution_> solutionDiff()The diff between the two solutions that this is part of. -
entity
Entity_ entity()The entity that this diff is of. -
entityMetaModel
PlanningEntityMetaModel<Solution_,Entity_> entityMetaModel()Describes thePlanningEntityclass. -
variableDiff
Returns a single diff for the entity's variables. It is a convenience method forvariableDiff(String)- if the entity provided more than one diff, which may happen for multi-variate entities, this method will throw.- Throws:
IllegalStateException- ifvariableDiffs()returns more than one diff.
-
variableDiff
Returns the diff for the variable with the given name, or null if the variable is not present in the diff.- Type Parameters:
Value_- Expected type of the variable.- Parameters:
variableName- Name of the variable to check for.- Returns:
- Null if the entity does not declare a variable of that name.
-
variableDiffs
Collection<PlanningVariableDiff<Solution_,Entity_, variableDiffs()?>> Returns the diffs of all variables of a single changed entity.
-