Record Class PolicyValidationWarning

java.lang.Object
java.lang.Record
io.github.teceli.resiliencia.compose.PolicyValidationWarning
Record Components:
outer - the PatternKind sitting further out in the chain
inner - the PatternKind being added, sitting further in
problem - human-readable description of why this ordering is a footgun
suggestedFix - human-readable suggestion for how to avoid it
All Implemented Interfaces:
ResilienceEvent

public record PolicyValidationWarning(Instant timestamp, PatternKind outer, PatternKind inner, String problem, String suggestedFix) extends Record implements ResilienceEvent
Emitted by Policy whenever a WARN-severity OrderingRule fires during Policy.and(Resilient) and construction proceeds — in addition to, not instead of, the existing SLF4J WARN log line. See docs/architecture/compose/policy.md's "Observing WARN-severity warnings" section for the full rationale. ERROR-severity rules (InvalidPolicyException) never produce this event: construction fails before a Policy instance exists to attach a listener to.
  • Constructor Details

    • PolicyValidationWarning

      public PolicyValidationWarning(Instant timestamp, PatternKind outer, PatternKind inner, String problem, String suggestedFix)
      Creates an instance of a PolicyValidationWarning record class.
      Parameters:
      timestamp - the value for the timestamp record component
      outer - the value for the outer record component
      inner - the value for the inner record component
      problem - the value for the problem record component
      suggestedFix - the value for the suggestedFix record component
  • Method Details

    • patternName

      public String patternName()
      Specified by:
      patternName in interface ResilienceEvent
    • 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.
    • timestamp

      public Instant timestamp()
      Returns the value of the timestamp record component.
      Specified by:
      timestamp in interface ResilienceEvent
      Returns:
      the value of the timestamp record component
    • outer

      public PatternKind outer()
      Returns the value of the outer record component.
      Returns:
      the value of the outer record component
    • inner

      public PatternKind inner()
      Returns the value of the inner record component.
      Returns:
      the value of the inner record component
    • problem

      public String problem()
      Returns the value of the problem record component.
      Returns:
      the value of the problem record component
    • suggestedFix

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