Record Class Breaker

java.lang.Object
java.lang.Record
dev.tripswitch.admin.Breaker

public record Breaker(String id, List<String> routerIds, String name, String metric, BreakerKind kind, Map<String,Object> kindParams, BreakerOp op, double threshold, int windowMs, int minCount, int minStateDurationMs, int cooldownMs, int evalIntervalMs, int halfOpenConfirmationMs, boolean halfOpenBackoffEnabled, int halfOpenBackoffCapMs, HalfOpenPolicy halfOpenIndeterminatePolicy, int recoveryWindowMs, int recoveryAllowRateRampSteps, Map<String,Object> actions, Map<String,String> metadata) extends Record
A circuit breaker configuration.
  • Constructor Details

    • Breaker

      public Breaker(String id, List<String> routerIds, String name, String metric, BreakerKind kind, Map<String,Object> kindParams, BreakerOp op, double threshold, int windowMs, int minCount, int minStateDurationMs, int cooldownMs, int evalIntervalMs, int halfOpenConfirmationMs, boolean halfOpenBackoffEnabled, int halfOpenBackoffCapMs, HalfOpenPolicy halfOpenIndeterminatePolicy, int recoveryWindowMs, int recoveryAllowRateRampSteps, Map<String,Object> actions, Map<String,String> metadata)
      Normalizes null fields that Jackson may leave unset for absent JSON keys.
  • Method Details

    • withRouterIds

      public Breaker withRouterIds(List<String> routerIds)
      Returns a copy of this breaker with the given router IDs.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • routerIds

      public List<String> routerIds()
      Returns the value of the routerIds record component.
      Returns:
      the value of the routerIds record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • metric

      public String metric()
      Returns the value of the metric record component.
      Returns:
      the value of the metric record component
    • kind

      public BreakerKind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • kindParams

      public Map<String,Object> kindParams()
      Returns the value of the kindParams record component.
      Returns:
      the value of the kindParams record component
    • op

      public BreakerOp op()
      Returns the value of the op record component.
      Returns:
      the value of the op record component
    • threshold

      public double threshold()
      Returns the value of the threshold record component.
      Returns:
      the value of the threshold record component
    • windowMs

      public int windowMs()
      Returns the value of the windowMs record component.
      Returns:
      the value of the windowMs record component
    • minCount

      public int minCount()
      Returns the value of the minCount record component.
      Returns:
      the value of the minCount record component
    • minStateDurationMs

      public int minStateDurationMs()
      Returns the value of the minStateDurationMs record component.
      Returns:
      the value of the minStateDurationMs record component
    • cooldownMs

      public int cooldownMs()
      Returns the value of the cooldownMs record component.
      Returns:
      the value of the cooldownMs record component
    • evalIntervalMs

      public int evalIntervalMs()
      Returns the value of the evalIntervalMs record component.
      Returns:
      the value of the evalIntervalMs record component
    • halfOpenConfirmationMs

      public int halfOpenConfirmationMs()
      Returns the value of the halfOpenConfirmationMs record component.
      Returns:
      the value of the halfOpenConfirmationMs record component
    • halfOpenBackoffEnabled

      public boolean halfOpenBackoffEnabled()
      Returns the value of the halfOpenBackoffEnabled record component.
      Returns:
      the value of the halfOpenBackoffEnabled record component
    • halfOpenBackoffCapMs

      public int halfOpenBackoffCapMs()
      Returns the value of the halfOpenBackoffCapMs record component.
      Returns:
      the value of the halfOpenBackoffCapMs record component
    • halfOpenIndeterminatePolicy

      public HalfOpenPolicy halfOpenIndeterminatePolicy()
      Returns the value of the halfOpenIndeterminatePolicy record component.
      Returns:
      the value of the halfOpenIndeterminatePolicy record component
    • recoveryWindowMs

      public int recoveryWindowMs()
      Returns the value of the recoveryWindowMs record component.
      Returns:
      the value of the recoveryWindowMs record component
    • recoveryAllowRateRampSteps

      public int recoveryAllowRateRampSteps()
      Returns the value of the recoveryAllowRateRampSteps record component.
      Returns:
      the value of the recoveryAllowRateRampSteps record component
    • actions

      public Map<String,Object> actions()
      Returns the value of the actions record component.
      Returns:
      the value of the actions record component
    • metadata

      public Map<String,String> metadata()
      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component