Record Class Obligation
java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase5.Obligation
A single contract/partiality obligation found in a construct body, tagged with the analysis (if
any) that discharges it (docs/tooling/EK9_SYMBOLIC_SCANNER_IMPLEMENTATION_SPEC.md ยง2.1). Kept as a
record (rather than a bare count) so a later slice can roll up by kind and the Layer-2 solver can
key its counterexamples to the undischarged ones.
-
Constructor Summary
ConstructorsConstructorDescriptionObligation(ObligationKind kind, DischargeReason discharge) Creates an instance of aObligationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedischargerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.(package private) booleankind()Returns the value of thekindrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Obligation
Obligation(ObligationKind kind, DischargeReason discharge) Creates an instance of aObligationrecord class.- Parameters:
kind- the value for thekindrecord componentdischarge- the value for thedischargerecord component
-
-
Method Details
-
isDischarged
boolean isDischarged() -
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). -
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
discharge
Returns the value of thedischargerecord component.- Returns:
- the value of the
dischargerecord component
-