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 Summary
ConstructorsConstructorDescriptionConsistencyTracker(IdentityHashMap<Object, Boolean> entityToIsInconsistentMap, HashMap<Class<?>, EntityConsistencyState<Solution_, Object>> entityClassToConsistencyStateMap, boolean isFrozen) Creates an instance of aConsistencyTrackerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theentityClassToConsistencyStateMaprecord component.Returns the value of theentityToIsInconsistentMaprecord component.final booleanIndicates whether some other object is "equal to" this one.static <Solution_>
ConsistencyTracker<Solution_>frozen(SolutionDescriptor<Solution_> solutionDescriptor, Object[] entityOrFacts) getDeclarativeEntityConsistencyState(EntityDescriptor<Solution_> entityDescriptor) final inthashCode()Returns a hash code value for this object.booleanisFrozen()If true, consistency and shadow variables are frozen and should not be updated.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConsistencyTracker
public ConsistencyTracker() -
ConsistencyTracker
public ConsistencyTracker(IdentityHashMap<Object, Boolean> entityToIsInconsistentMap, HashMap<Class<?>, EntityConsistencyState<Solution_, Object>> entityClassToConsistencyStateMap, boolean isFrozen) Creates an instance of aConsistencyTrackerrecord class.- Parameters:
entityToIsInconsistentMap- the value for theentityToIsInconsistentMaprecord componententityClassToConsistencyStateMap- the value for theentityClassToConsistencyStateMaprecord componentisFrozen- the value for theisFrozenrecord 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 viafrozen(SolutionDescriptor, Object[]).- Returns:
- true if consistency and shadow variables are frozen and should not be updated
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
entityToIsInconsistentMap
Returns the value of theentityToIsInconsistentMaprecord component.- Returns:
- the value of the
entityToIsInconsistentMaprecord component
-
entityClassToConsistencyStateMap
public HashMap<Class<?>,EntityConsistencyState<Solution_, entityClassToConsistencyStateMap()Object>> Returns the value of theentityClassToConsistencyStateMaprecord component.- Returns:
- the value of the
entityClassToConsistencyStateMaprecord component
-