Record Class ConstraintInfo
java.lang.Object
java.lang.Record
ai.timefold.solver.service.definition.api.description.ConstraintInfo
- Record Components:
id- Stable unique identifier of the constraint.name- Human-readable name of the constraint.description- Explanation of the constraint and its goal.constraintGroup-ConstraintGroupInfoof a constraint groups this constraint belongs to.
- All Implemented Interfaces:
ai.timefold.solver.core.api.score.stream.ConstraintMetadata
@NullMarked
public record ConstraintInfo(String id, @Nullable String name, @Nullable String description, @Nullable ConstraintGroupInfo constraintGroup)
extends Record
implements ai.timefold.solver.core.api.score.stream.ConstraintMetadata
Describes a score constraint in a form suitable for model descriptors and other consumer-facing metadata.
Instances of this record are attached to constraints through
ConstraintBuilder.asConstraint(ConstraintMetadata) and are later used
to expose stable identifiers, user-facing names, and grouping information.
-
Constructor Summary
ConstructorsConstructorDescriptionConstraintInfo(String id, @Nullable String name, @Nullable String description, @Nullable ConstraintGroupInfo constraintGroup) Creates an instance of aConstraintInforecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable ConstraintGroupInfoReturns the value of theconstraintGrouprecord component.@Nullable StringReturns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.@Nullable Stringname()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConstraintInfo
public ConstraintInfo(String id, @Nullable String name, @Nullable String description, @Nullable ConstraintGroupInfo constraintGroup) Creates an instance of aConstraintInforecord class.- Parameters:
id- the value for theidrecord componentname- the value for thenamerecord componentdescription- the value for thedescriptionrecord componentconstraintGroup- the value for theconstraintGrouprecord component
-
-
Method Details
-
toString
-
hashCode
-
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). -
id
-
name
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
constraintGroup
Returns the value of theconstraintGrouprecord component.- Returns:
- the value of the
constraintGrouprecord component
-