Record Class ChangedVariableNotifier<Solution_>

java.lang.Object
java.lang.Record
ai.timefold.solver.core.impl.domain.variable.declarative.ChangedVariableNotifier<Solution_>

public record ChangedVariableNotifier<Solution_>(BiConsumer<VariableDescriptor<Solution_>,Object> beforeVariableChanged, BiConsumer<VariableDescriptor<Solution_>,Object> afterVariableChanged, @Nullable InnerScoreDirector<Solution_,?> innerScoreDirector) extends Record
  • Constructor Details

    • ChangedVariableNotifier

      public ChangedVariableNotifier(BiConsumer<VariableDescriptor<Solution_>,Object> beforeVariableChanged, BiConsumer<VariableDescriptor<Solution_>,Object> afterVariableChanged, @Nullable InnerScoreDirector<Solution_,?> innerScoreDirector)
      Creates an instance of a ChangedVariableNotifier record class.
      Parameters:
      beforeVariableChanged - the value for the beforeVariableChanged record component
      afterVariableChanged - the value for the afterVariableChanged record component
      innerScoreDirector - the value for the innerScoreDirector record component
  • Method Details

    • empty

      public static <Solution_> ChangedVariableNotifier<Solution_> empty()
    • of

      public static <Solution_> ChangedVariableNotifier<Solution_> of(InnerScoreDirector<Solution_,?> scoreDirector)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • beforeVariableChanged

      public BiConsumer<VariableDescriptor<Solution_>,Object> beforeVariableChanged()
      Returns the value of the beforeVariableChanged record component.
      Returns:
      the value of the beforeVariableChanged record component
    • afterVariableChanged

      public BiConsumer<VariableDescriptor<Solution_>,Object> afterVariableChanged()
      Returns the value of the afterVariableChanged record component.
      Returns:
      the value of the afterVariableChanged record component
    • innerScoreDirector

      public @Nullable InnerScoreDirector<Solution_,?> innerScoreDirector()
      Returns the value of the innerScoreDirector record component.
      Returns:
      the value of the innerScoreDirector record component