Record Class IndicatorNotice.Key

java.lang.Object
java.lang.Record
com.wualabs.qtsurfer.engine.indicators.core.IndicatorNotice.Key
Record Components:
code - the notice code
indicatorName - the indicator the notice is about
Enclosing class:
IndicatorNotice

public static record IndicatorNotice.Key(String code, String indicatorName) extends Record
What makes a notice unique: the condition, and the indicator it concerns. Two notices sharing a key are the same diagnostic reported twice — the same wiring problem seen on a later tick — so a collector keys on this to report it once.

A record rather than a formatted string on purpose. A concatenated key would need a separator guaranteed absent from both halves, and the engine cannot promise that: InstrumentMapRTIndicator.add accepts any indicator name a strategy author passes, with no character validation anywhere. Whatever separator were chosen, a name containing it would make two distinct pairs collapse into one key and silence a real notice.

  • Constructor Details

    • Key

      public Key(String code, String indicatorName)
      Creates an instance of a Key record class.
      Parameters:
      code - the value for the code record component
      indicatorName - the value for the indicatorName record component
  • Method Details

    • 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.
    • code

      public String code()
      Returns the value of the code record component.
      Returns:
      the value of the code record component
    • indicatorName

      public String indicatorName()
      Returns the value of the indicatorName record component.
      Returns:
      the value of the indicatorName record component