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 countermeasure
counterMeasure - the countermeasure that mitigates the threat's type in its context

public record Mitigation(RoleBinding binding, CounterMeasure counterMeasure) extends Record
  • Constructor Details

    • Mitigation

      public Mitigation(RoleBinding binding, CounterMeasure counterMeasure)
      Creates an instance of a Mitigation record class.
      Parameters:
      binding - the value for the binding record component
      counterMeasure - the value for the counterMeasure record component
  • Method Details

    • solution

      public Solution solution()
      Returns:
      the solution the binding belongs to, or null if it is not part of one
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • binding

      public RoleBinding binding()
      Returns the value of the binding record component.
      Returns:
      the value of the binding record component
    • counterMeasure

      public CounterMeasure counterMeasure()
      Returns the value of the counterMeasure record component.
      Returns:
      the value of the counterMeasure record component