public static final class CircuitBreakerStatus.Builder extends Object
CircuitBreakerStatus
. Initialize attributes and then invoke the build()
method to
create an immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or
collection, but instead used immediately to create instances.
Modifier and Type | Method and Description |
---|---|
CircuitBreakerStatus |
build()
Builds a new
CircuitBreakerStatus . |
CircuitBreakerStatus.Builder |
failedThroughputOneMinute(double failedThroughputOneMinute)
Initializes the value for the
failedThroughputOneMinute
attribute. |
CircuitBreakerStatus.Builder |
from(AbstractCircuitBreakerStatus instance)
Fill a builder with attribute values from the provided
AbstractCircuitBreakerStatus
instance. |
CircuitBreakerStatus.Builder |
id(String id)
Initializes the value for the
id attribute. |
CircuitBreakerStatus.Builder |
latencyMicros(Latency latencyMicros)
Initializes the value for the
latencyMicros attribute. |
CircuitBreakerStatus.Builder |
state(String state)
Initializes the value for the
state
attribute. |
CircuitBreakerStatus.Builder |
throughputOneMinute(double throughputOneMinute)
Initializes the value for the
throughputOneMinute attribute. |
CircuitBreakerStatus.Builder |
timestamp(Instant timestamp)
Initializes the value for the
timestamp
attribute. |
CircuitBreakerStatus.Builder |
totalFailureCount(long totalFailureCount)
Initializes the value for the
totalFailureCount attribute. |
CircuitBreakerStatus.Builder |
totalSuccessCount(long totalSuccessCount)
Initializes the value for the
totalSuccessCount attribute. |
public final CircuitBreakerStatus.Builder from(AbstractCircuitBreakerStatus instance)
AbstractCircuitBreakerStatus
instance. Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance
- The instance from which to copy valuesthis
builder for use in a chained invocationpublic final CircuitBreakerStatus.Builder id(String id)
id
attribute.id
- The value for idthis
builder for use in a chained invocationpublic final CircuitBreakerStatus.Builder timestamp(Instant timestamp)
timestamp
attribute.
If not set, this attribute will have a default value as returned by the initializer of
timestamp
.
timestamp
- The value for timestampthis
builder for use in a chained invocationpublic final CircuitBreakerStatus.Builder state(String state)
state
attribute.state
- The value for statethis
builder for use in a chained invocationpublic final CircuitBreakerStatus.Builder totalSuccessCount(long totalSuccessCount)
totalSuccessCount
attribute.totalSuccessCount
- The value for totalSuccessCountthis
builder for use in a chained invocationpublic final CircuitBreakerStatus.Builder totalFailureCount(long totalFailureCount)
totalFailureCount
attribute.totalFailureCount
- The value for totalFailureCountthis
builder for use in a chained invocationpublic final CircuitBreakerStatus.Builder latencyMicros(Latency latencyMicros)
latencyMicros
attribute.latencyMicros
- The value for latencyMicrosthis
builder for use in a chained invocationpublic final CircuitBreakerStatus.Builder throughputOneMinute(double throughputOneMinute)
throughputOneMinute
attribute.throughputOneMinute
- The value for throughputOneMinutethis
builder for use in a chained invocationpublic final CircuitBreakerStatus.Builder failedThroughputOneMinute(double failedThroughputOneMinute)
failedThroughputOneMinute
attribute.failedThroughputOneMinute
- The value for failedThroughputOneMinutethis
builder for use in a chained invocationpublic CircuitBreakerStatus build() throws IllegalStateException
CircuitBreakerStatus
.IllegalStateException
- if any required attributes are missing