Package ch.so.agi.mcp.constraint
Record Class ConstraintGoalSolver.Solution
java.lang.Object
java.lang.Record
ch.so.agi.mcp.constraint.ConstraintGoalSolver.Solution
- Enclosing class:
ConstraintGoalSolver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theassignmentrecord component.intattempts()Returns the value of theattemptsrecord component.final booleanIndicates whether some other object is "equal to" this one.goal()Returns the value of thegoalrecord component.final inthashCode()Returns a hash code value for this object.reason()Returns the value of thereasonrecord component.Returns the value of thereasonCoderecord component.booleansolved()Returns the value of thesolvedrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Solution
public Solution(ConstraintExpressionEngine.TestGoal goal, boolean solved, Map<String, Object> assignment, int attempts, String reasonCode, String reason) Creates an instance of aSolutionrecord class.- Parameters:
goal- the value for thegoalrecord componentsolved- the value for thesolvedrecord componentassignment- the value for theassignmentrecord componentattempts- the value for theattemptsrecord componentreasonCode- the value for thereasonCoderecord componentreason- the value for thereasonrecord component
-
-
Method Details
-
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 '=='. -
goal
Returns the value of thegoalrecord component.- Returns:
- the value of the
goalrecord component
-
solved
public boolean solved()Returns the value of thesolvedrecord component.- Returns:
- the value of the
solvedrecord component
-
assignment
Returns the value of theassignmentrecord component.- Returns:
- the value of the
assignmentrecord component
-
attempts
public int attempts()Returns the value of theattemptsrecord component.- Returns:
- the value of the
attemptsrecord component
-
reasonCode
Returns the value of thereasonCoderecord component.- Returns:
- the value of the
reasonCoderecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-