Record Class Mitigation
java.lang.Object
java.lang.Record
be.kuleuven.cs.distrinet.sparta.core.analysis.Mitigation
- Record Components:
binding- the role binding on the threatened element whose role is subjected to the countermeasurecounterMeasure- the countermeasure that mitigates the threat's type in its context
A countermeasure the risk calculation applies to a threat, together with the role binding
through which it applies (see
RiskCalculation.mitigations(be.kuleuven.cs.distrinet.sparta.spartamodel.DataFlow, be.kuleuven.cs.distrinet.sparta.spartamodel.ThreatType, java.util.List<be.kuleuven.cs.distrinet.sparta.spartamodel.RoleBinding>)).-
Constructor Summary
ConstructorsConstructorDescriptionMitigation(RoleBinding binding, CounterMeasure counterMeasure) Creates an instance of aMitigationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbinding()Returns the value of thebindingrecord component.Returns the value of thecounterMeasurerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.solution()final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Mitigation
Creates an instance of aMitigationrecord class.- Parameters:
binding- the value for thebindingrecord componentcounterMeasure- the value for thecounterMeasurerecord component
-
-
Method Details
-
solution
- Returns:
- the solution the binding belongs to, or
nullif it is not part of one
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
binding
Returns the value of thebindingrecord component.- Returns:
- the value of the
bindingrecord component
-
counterMeasure
Returns the value of thecounterMeasurerecord component.- Returns:
- the value of the
counterMeasurerecord component
-