Class CircuitBreakerFailureCondition
java.lang.Object
com.azure.resourcemanager.apimanagement.models.CircuitBreakerFailureCondition
- All Implemented Interfaces:
com.azure.json.JsonSerializable<CircuitBreakerFailureCondition>
public final class CircuitBreakerFailureCondition
extends Object
implements com.azure.json.JsonSerializable<CircuitBreakerFailureCondition>
The trip conditions of the circuit breaker.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of CircuitBreakerFailureCondition class. -
Method Summary
Modifier and TypeMethodDescriptioncount()Get the count property: The threshold for opening the circuit.Get the errorReasons property: The error reasons which are considered as failure.fromJson(com.azure.json.JsonReader jsonReader) Reads an instance of CircuitBreakerFailureCondition from the JsonReader.interval()Get the interval property: The interval during which the failures are counted.Get the percentage property: The threshold for opening the circuit.Get the statusCodeRanges property: The status code ranges which are considered as failure.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.Set the count property: The threshold for opening the circuit.withErrorReasons(List<String> errorReasons) Set the errorReasons property: The error reasons which are considered as failure.withInterval(Duration interval) Set the interval property: The interval during which the failures are counted.withPercentage(Long percentage) Set the percentage property: The threshold for opening the circuit.withStatusCodeRanges(List<FailureStatusCodeRange> statusCodeRanges) Set the statusCodeRanges property: The status code ranges which are considered as failure.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
CircuitBreakerFailureCondition
public CircuitBreakerFailureCondition()Creates an instance of CircuitBreakerFailureCondition class.
-
-
Method Details
-
count
Get the count property: The threshold for opening the circuit.- Returns:
- the count value.
-
withCount
Set the count property: The threshold for opening the circuit.- Parameters:
count- the count value to set.- Returns:
- the CircuitBreakerFailureCondition object itself.
-
percentage
Get the percentage property: The threshold for opening the circuit.- Returns:
- the percentage value.
-
withPercentage
Set the percentage property: The threshold for opening the circuit.- Parameters:
percentage- the percentage value to set.- Returns:
- the CircuitBreakerFailureCondition object itself.
-
interval
Get the interval property: The interval during which the failures are counted.- Returns:
- the interval value.
-
withInterval
Set the interval property: The interval during which the failures are counted.- Parameters:
interval- the interval value to set.- Returns:
- the CircuitBreakerFailureCondition object itself.
-
statusCodeRanges
Get the statusCodeRanges property: The status code ranges which are considered as failure.- Returns:
- the statusCodeRanges value.
-
withStatusCodeRanges
public CircuitBreakerFailureCondition withStatusCodeRanges(List<FailureStatusCodeRange> statusCodeRanges) Set the statusCodeRanges property: The status code ranges which are considered as failure.- Parameters:
statusCodeRanges- the statusCodeRanges value to set.- Returns:
- the CircuitBreakerFailureCondition object itself.
-
errorReasons
Get the errorReasons property: The error reasons which are considered as failure.- Returns:
- the errorReasons value.
-
withErrorReasons
Set the errorReasons property: The error reasons which are considered as failure.- Parameters:
errorReasons- the errorReasons value to set.- Returns:
- the CircuitBreakerFailureCondition object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<CircuitBreakerFailureCondition>- Throws:
IOException
-
fromJson
public static CircuitBreakerFailureCondition fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of CircuitBreakerFailureCondition from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of CircuitBreakerFailureCondition if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IOException- If an error occurs while reading the CircuitBreakerFailureCondition.
-