Record Class DrugInteractionChecker.InteractionAlert
java.lang.Object
java.lang.Record
org.episteme.natural.medicine.DrugInteractionChecker.InteractionAlert
- Enclosing class:
DrugInteractionChecker
public static record DrugInteractionChecker.InteractionAlert(Medication drugA, Medication drugB, DrugInteractionChecker.Severity severity, String reason)
extends Record
Represents a specific interaction between two drugs.
-
Constructor Summary
ConstructorsConstructorDescriptionInteractionAlert(Medication drugA, Medication drugB, DrugInteractionChecker.Severity severity, String reason) Creates an instance of aInteractionAlertrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondrugA()Returns the value of thedrugArecord component.drugB()Returns the value of thedrugBrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.reason()Returns the value of thereasonrecord component.severity()Returns the value of theseverityrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
InteractionAlert
public InteractionAlert(Medication drugA, Medication drugB, DrugInteractionChecker.Severity severity, String reason) Creates an instance of aInteractionAlertrecord class.- Parameters:
drugA- the value for thedrugArecord componentdrugB- the value for thedrugBrecord componentseverity- the value for theseverityrecord componentreason- the value for thereasonrecord 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). -
drugA
Returns the value of thedrugArecord component.- Returns:
- the value of the
drugArecord component
-
drugB
Returns the value of thedrugBrecord component.- Returns:
- the value of the
drugBrecord component
-
severity
Returns the value of theseverityrecord component.- Returns:
- the value of the
severityrecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-