Record Class ConsistencyTracker<Solution_>

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

@NullMarked public record ConsistencyTracker<Solution_>(IdentityHashMap<Object,Boolean> entityToIsInconsistentMap, HashMap<Class<?>,EntityConsistencyState<Solution_,Object>> entityClassToConsistencyStateMap, boolean isFrozen) extends Record
  • Constructor Details

    • ConsistencyTracker

      public ConsistencyTracker()
    • ConsistencyTracker

      public ConsistencyTracker(IdentityHashMap<Object,Boolean> entityToIsInconsistentMap, HashMap<Class<?>,EntityConsistencyState<Solution_,Object>> entityClassToConsistencyStateMap, boolean isFrozen)
      Creates an instance of a ConsistencyTracker record class.
      Parameters:
      entityToIsInconsistentMap - the value for the entityToIsInconsistentMap record component
      entityClassToConsistencyStateMap - the value for the entityClassToConsistencyStateMap record component
      isFrozen - the value for the isFrozen record component
  • Method Details

    • frozen

      public static <Solution_> ConsistencyTracker<Solution_> frozen(SolutionDescriptor<Solution_> solutionDescriptor, Object[] entityOrFacts)
    • getDeclarativeEntityConsistencyState

      public EntityConsistencyState<Solution_,Object> getDeclarativeEntityConsistencyState(EntityDescriptor<Solution_> entityDescriptor)
    • isFrozen

      public boolean isFrozen()
      If true, consistency and shadow variables are frozen and should not be updated. ConstraintVerifier creates a frozen instance via frozen(SolutionDescriptor, Object[]).
      Returns:
      true if consistency and shadow variables are frozen and should not be updated
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • entityToIsInconsistentMap

      public IdentityHashMap<Object,Boolean> entityToIsInconsistentMap()
      Returns the value of the entityToIsInconsistentMap record component.
      Returns:
      the value of the entityToIsInconsistentMap record component
    • entityClassToConsistencyStateMap

      public HashMap<Class<?>,EntityConsistencyState<Solution_,Object>> entityClassToConsistencyStateMap()
      Returns the value of the entityClassToConsistencyStateMap record component.
      Returns:
      the value of the entityClassToConsistencyStateMap record component