Record Class CircuitState.HalfOpen
java.lang.Object
java.lang.Record
io.github.teceli.resiliencia.patterns.circuitbreaker.CircuitState.HalfOpen
- All Implemented Interfaces:
CircuitState
- Enclosing interface:
CircuitState
public static record CircuitState.HalfOpen(int permitsIssued, int successes)
extends Record
implements CircuitState
A limited number of test calls are let through to probe whether the downstream has
recovered.
permitsIssued counts test calls allowed so far; successes counts
how many of them succeeded.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.teceli.resiliencia.patterns.circuitbreaker.CircuitState
CircuitState.Closed, CircuitState.HalfOpen, CircuitState.Open -
Constructor Summary
ConstructorsConstructorDescriptionHalfOpen(int permitsIssued, int successes) Creates an instance of aHalfOpenrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thepermitsIssuedrecord component.intReturns the value of thesuccessesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
HalfOpen
public HalfOpen(int permitsIssued, int successes) Creates an instance of aHalfOpenrecord class.- Parameters:
permitsIssued- the value for thepermitsIssuedrecord componentsuccesses- the value for thesuccessesrecord component
-
-
Method Details
-
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. All components in this record class are compared with '=='. -
permitsIssued
public int permitsIssued()Returns the value of thepermitsIssuedrecord component.- Returns:
- the value of the
permitsIssuedrecord component
-
successes
public int successes()Returns the value of thesuccessesrecord component.- Returns:
- the value of the
successesrecord component
-