Record Class ExternalHaltingCondition
java.lang.Object
java.lang.Record
fr.inria.rules.integraal.component_builder.externalHaltingConditions.ExternalHaltingCondition
- Record Components:
keyword- the keyword representing the condition.value- the value of the condition.
public record ExternalHaltingCondition(InteGraalKeywords.Algorithms.ExternalHaltingConditions keyword, Object value)
extends Record
Represents a pair of halting condition: a keyword and its associated value.
-
Constructor Summary
ConstructorsConstructorDescriptionExternalHaltingCondition(InteGraalKeywords.Algorithms.ExternalHaltingConditions keyword, Object value) Custom constructor that enforces type constraints based on the keyword. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.<T> TgetValue()Returns the value cast to the correct type based on the keyword.final inthashCode()Returns a hash code value for this object.keyword()Returns the value of thekeywordrecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
ExternalHaltingCondition
public ExternalHaltingCondition(InteGraalKeywords.Algorithms.ExternalHaltingConditions keyword, Object value) Custom constructor that enforces type constraints based on the keyword.- Parameters:
keyword- the halting condition keyword.value- the value associated with the keyword.- Throws:
IllegalArgumentException- if the value cannot be cast to Long or Duration, depending on the keyword.
-
-
Method Details
-
getValue
public <T> T getValue()Returns the value cast to the correct type based on the keyword.- Type Parameters:
T- The expected type of the value.- Returns:
- The value cast to the specified type.
- Throws:
ClassCastException- if the value cannot be cast to the expected type.
-
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). -
keyword
-
value
-