Record Class CircuitState.Open
java.lang.Object
java.lang.Record
io.github.teceli.resiliencia.patterns.circuitbreaker.CircuitState.Open
- All Implemented Interfaces:
CircuitState
- Enclosing interface:
CircuitState
public static record CircuitState.Open(Instant openedAt, Duration remainingWait)
extends Record
implements CircuitState
Calls are rejected immediately.
openedAt is when the circuit opened;
remainingWait is how much longer it stays Open before a HalfOpen test call is
attempted. Must not be negative.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.teceli.resiliencia.patterns.circuitbreaker.CircuitState
CircuitState.Closed, CircuitState.HalfOpen, CircuitState.Open -
Constructor Summary
Constructors -
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.openedAt()Returns the value of theopenedAtrecord component.Returns the value of theremainingWaitrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Open
Creates an instance of aOpenrecord class.- Parameters:
openedAt- the value for theopenedAtrecord componentremainingWait- the value for theremainingWaitrecord 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 withObjects::equals(Object,Object). -
openedAt
Returns the value of theopenedAtrecord component.- Returns:
- the value of the
openedAtrecord component
-
remainingWait
Returns the value of theremainingWaitrecord component.- Returns:
- the value of the
remainingWaitrecord component
-