Class ResourceCounter

java.lang.Object
com.azure.search.documents.indexes.models.ResourceCounter
All Implemented Interfaces:
com.azure.json.JsonSerializable<ResourceCounter>

public final class ResourceCounter extends Object implements com.azure.json.JsonSerializable<ResourceCounter>
Represents a resource's usage and quota.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ResourceCounter(long usage)
    Creates an instance of ResourceCounter class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of ResourceCounter from the JsonReader.
    Get the quota property: The resource amount quota.
    long
    Get the usage property: The resource usage amount.
    setQuota(Long quota)
    Set the quota property: The resource amount quota.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • ResourceCounter

      public ResourceCounter(long usage)
      Creates an instance of ResourceCounter class.
      Parameters:
      usage - the usage value to set.
  • Method Details

    • getUsage

      public long getUsage()
      Get the usage property: The resource usage amount.
      Returns:
      the usage value.
    • getQuota

      public Long getQuota()
      Get the quota property: The resource amount quota.
      Returns:
      the quota value.
    • setQuota

      public ResourceCounter setQuota(Long quota)
      Set the quota property: The resource amount quota.
      Parameters:
      quota - the quota value to set.
      Returns:
      the ResourceCounter object itself.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<ResourceCounter>
      Throws:
      IOException
    • fromJson

      public static ResourceCounter fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of ResourceCounter from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of ResourceCounter if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the ResourceCounter.