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 Details

    • CircuitBreakerFailureCondition

      public CircuitBreakerFailureCondition()
      Creates an instance of CircuitBreakerFailureCondition class.
  • Method Details

    • count

      public Long count()
      Get the count property: The threshold for opening the circuit.
      Returns:
      the count value.
    • withCount

      public CircuitBreakerFailureCondition withCount(Long count)
      Set the count property: The threshold for opening the circuit.
      Parameters:
      count - the count value to set.
      Returns:
      the CircuitBreakerFailureCondition object itself.
    • percentage

      public Long percentage()
      Get the percentage property: The threshold for opening the circuit.
      Returns:
      the percentage value.
    • withPercentage

      public CircuitBreakerFailureCondition withPercentage(Long percentage)
      Set the percentage property: The threshold for opening the circuit.
      Parameters:
      percentage - the percentage value to set.
      Returns:
      the CircuitBreakerFailureCondition object itself.
    • interval

      public Duration interval()
      Get the interval property: The interval during which the failures are counted.
      Returns:
      the interval value.
    • withInterval

      public CircuitBreakerFailureCondition withInterval(Duration interval)
      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

      public List<FailureStatusCodeRange> 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

      public List<String> errorReasons()
      Get the errorReasons property: The error reasons which are considered as failure.
      Returns:
      the errorReasons value.
    • withErrorReasons

      public CircuitBreakerFailureCondition withErrorReasons(List<String> errorReasons)
      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

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.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.