Record Class VariableId<Solution_>
java.lang.Object
java.lang.Record
ai.timefold.solver.core.impl.domain.variable.listener.support.violation.VariableId<Solution_>
- Record Components:
variableDescriptor- The variable thisVariableIdrefers to.entity- The entity thisVariableIdrefers to.
public record VariableId<Solution_>(VariableDescriptor<Solution_> variableDescriptor, Object entity)
extends Record
A
VariableId is an entity/variable of a given solution.
VariableId cannot be compared across different solution instances,
since variableDescriptor and entity are compared by reference equality.-
Constructor Summary
ConstructorsConstructorDescriptionVariableId(VariableDescriptor<Solution_> variableDescriptor, Object entity) Creates an instance of aVariableIdrecord class. -
Method Summary
Modifier and TypeMethodDescriptionentity()Returns the value of theentityrecord component.booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Returns the value of thevariableDescriptorrecord component.
-
Constructor Details
-
VariableId
Creates an instance of aVariableIdrecord class.- Parameters:
variableDescriptor- the value for thevariableDescriptorrecord componententity- the value for theentityrecord component
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
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. -
variableDescriptor
Returns the value of thevariableDescriptorrecord component.- Returns:
- the value of the
variableDescriptorrecord component
-
entity
Returns the value of theentityrecord component.- Returns:
- the value of the
entityrecord component
-