Record Class Tm1ErrorClassifier.Rule

java.lang.Object
java.lang.Record
io.skipcheck.tm1.client.error.Tm1ErrorClassifier.Rule
Record Components:
status - the HTTP status to match, or null for any
code - the error code to match, or null for any
message - a pattern to find in the message, or null for any
kind - the kind to report on a match
Enclosing class:
Tm1ErrorClassifier

public static record Tm1ErrorClassifier.Rule(@Nullable Integer status, @Nullable String code, @Nullable Pattern message, Tm1ErrorKind kind) extends Record
One classification rule. Each condition that's set must match: the status if not null, the code exactly, and the message pattern (case-insensitive, anywhere in the message).
  • Constructor Details

    • Rule

      public Rule(@Nullable Integer status, @Nullable String code, @Nullable Pattern message, Tm1ErrorKind kind)
      Checks that the rule has a kind and at least one condition.
  • Method Details

    • message

      public static Tm1ErrorClassifier.Rule message(String regex, Tm1ErrorKind kind)
      A rule matching a message pattern, case-insensitively.
      Parameters:
      regex - the pattern to find anywhere in the message
      kind - the kind to report on a match
      Returns:
      the rule
    • code

      public static Tm1ErrorClassifier.Rule code(String code, Tm1ErrorKind kind)
      A rule matching an error code.
      Parameters:
      code - the error code to match exactly, such as "248"
      kind - the kind to report on a match
      Returns:
      the rule
    • 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.
    • status

      public @Nullable Integer status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • code

      public @Nullable String code()
      Returns the value of the code record component.
      Returns:
      the value of the code record component
    • message

      public @Nullable Pattern message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component
    • kind

      public Tm1ErrorKind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component