Record Class CircuitBreakerCounters.CallRecorded
java.lang.Object
java.lang.Record
io.github.teceli.resiliencia.metrics.circuitbreaker.CircuitBreakerCounters.CallRecorded
- All Implemented Interfaces:
CircuitBreakerCounters,Counters
- Enclosing interface:
CircuitBreakerCounters
public static record CircuitBreakerCounters.CallRecorded(String name, boolean successful, Duration elapsed)
extends Record
implements CircuitBreakerCounters
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.teceli.resiliencia.metrics.circuitbreaker.CircuitBreakerCounters
CircuitBreakerCounters.CallRecorded, CircuitBreakerCounters.ClosedFromHalfOpen, CircuitBreakerCounters.Rejected, CircuitBreakerCounters.Transition -
Constructor Summary
ConstructorsConstructorDescriptionCallRecorded(String name, boolean successful, Duration elapsed) Creates an instance of aCallRecordedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionelapsed()Returns the value of theelapsedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.booleanReturns the value of thesuccessfulrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CallRecorded
Creates an instance of aCallRecordedrecord class.- Parameters:
name- the value for thenamerecord componentsuccessful- the value for thesuccessfulrecord componentelapsed- the value for theelapsedrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
successful
public boolean successful()Returns the value of thesuccessfulrecord component.- Returns:
- the value of the
successfulrecord component
-
elapsed
Returns the value of theelapsedrecord component.- Returns:
- the value of the
elapsedrecord component
-