Package dev.tripswitch.admin
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 Summary
ConstructorsConstructorDescriptionBreaker(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 Summary
Modifier and TypeMethodDescriptionactions()Returns the value of theactionsrecord component.intReturns the value of thecooldownMsrecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of theevalIntervalMsrecord component.intReturns the value of thehalfOpenBackoffCapMsrecord component.booleanReturns the value of thehalfOpenBackoffEnabledrecord component.intReturns the value of thehalfOpenConfirmationMsrecord component.Returns the value of thehalfOpenIndeterminatePolicyrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.kind()Returns the value of thekindrecord component.Returns the value of thekindParamsrecord component.metadata()Returns the value of themetadatarecord component.metric()Returns the value of themetricrecord component.intminCount()Returns the value of theminCountrecord component.intReturns the value of theminStateDurationMsrecord component.name()Returns the value of thenamerecord component.op()Returns the value of theoprecord component.intReturns the value of therecoveryAllowRateRampStepsrecord component.intReturns the value of therecoveryWindowMsrecord component.Returns the value of therouterIdsrecord component.doubleReturns the value of thethresholdrecord component.final StringtoString()Returns a string representation of this record class.intwindowMs()Returns the value of thewindowMsrecord component.withRouterIds(List<String> routerIds) Returns a copy of this breaker with the given router IDs.
-
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
Returns a copy of this breaker with the given router IDs. -
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
routerIds
Returns the value of therouterIdsrecord component.- Returns:
- the value of the
routerIdsrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
metric
Returns the value of themetricrecord component.- Returns:
- the value of the
metricrecord component
-
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
kindParams
Returns the value of thekindParamsrecord component.- Returns:
- the value of the
kindParamsrecord component
-
op
Returns the value of theoprecord component.- Returns:
- the value of the
oprecord component
-
threshold
public double threshold()Returns the value of thethresholdrecord component.- Returns:
- the value of the
thresholdrecord component
-
windowMs
public int windowMs()Returns the value of thewindowMsrecord component.- Returns:
- the value of the
windowMsrecord component
-
minCount
public int minCount()Returns the value of theminCountrecord component.- Returns:
- the value of the
minCountrecord component
-
minStateDurationMs
public int minStateDurationMs()Returns the value of theminStateDurationMsrecord component.- Returns:
- the value of the
minStateDurationMsrecord component
-
cooldownMs
public int cooldownMs()Returns the value of thecooldownMsrecord component.- Returns:
- the value of the
cooldownMsrecord component
-
evalIntervalMs
public int evalIntervalMs()Returns the value of theevalIntervalMsrecord component.- Returns:
- the value of the
evalIntervalMsrecord component
-
halfOpenConfirmationMs
public int halfOpenConfirmationMs()Returns the value of thehalfOpenConfirmationMsrecord component.- Returns:
- the value of the
halfOpenConfirmationMsrecord component
-
halfOpenBackoffEnabled
public boolean halfOpenBackoffEnabled()Returns the value of thehalfOpenBackoffEnabledrecord component.- Returns:
- the value of the
halfOpenBackoffEnabledrecord component
-
halfOpenBackoffCapMs
public int halfOpenBackoffCapMs()Returns the value of thehalfOpenBackoffCapMsrecord component.- Returns:
- the value of the
halfOpenBackoffCapMsrecord component
-
halfOpenIndeterminatePolicy
Returns the value of thehalfOpenIndeterminatePolicyrecord component.- Returns:
- the value of the
halfOpenIndeterminatePolicyrecord component
-
recoveryWindowMs
public int recoveryWindowMs()Returns the value of therecoveryWindowMsrecord component.- Returns:
- the value of the
recoveryWindowMsrecord component
-
recoveryAllowRateRampSteps
public int recoveryAllowRateRampSteps()Returns the value of therecoveryAllowRateRampStepsrecord component.- Returns:
- the value of the
recoveryAllowRateRampStepsrecord component
-
actions
Returns the value of theactionsrecord component.- Returns:
- the value of the
actionsrecord component
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-