Record Class DefaultConstraintWeightOverrides<Score_ extends Score<Score_>>
java.lang.Object
java.lang.Record
ai.timefold.solver.core.impl.domain.solution.DefaultConstraintWeightOverrides<Score_>
- All Implemented Interfaces:
ConstraintWeightOverrides<Score_>
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultConstraintWeightOverrides(Map<String, Score_> constraintWeightMap) Creates an instance of aDefaultConstraintWeightOverridesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconstraintWeightMaprecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable Score_getConstraintWeight(@NonNull String constraintName) Return a constraint weight for a particular constraint.Returns all known constraints.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DefaultConstraintWeightOverrides
Creates an instance of aDefaultConstraintWeightOverridesrecord class.- Parameters:
constraintWeightMap- the value for theconstraintWeightMaprecord component
-
-
Method Details
-
getConstraintWeight
Description copied from interface:ConstraintWeightOverridesReturn a constraint weight for a particular constraint.- Specified by:
getConstraintWeightin interfaceConstraintWeightOverrides<Score_ extends Score<Score_>>- Returns:
- null if the constraint name is not known
-
getKnownConstraintNames
Description copied from interface:ConstraintWeightOverridesReturns all known constraints.- Specified by:
getKnownConstraintNamesin interfaceConstraintWeightOverrides<Score_ extends Score<Score_>>- Returns:
- All constraint names for which
ConstraintWeightOverrides.getConstraintWeight(String)returns a non-null value.
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
constraintWeightMap
Returns the value of theconstraintWeightMaprecord component.- Returns:
- the value of the
constraintWeightMaprecord component
-