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 -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceCounterfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ResourceCounter from the JsonReader.getQuota()Get the quota property: The resource amount quota.longgetUsage()Get the usage property: The resource usage amount.Set the quota property: The resource amount quota.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) 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
-
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
Get the quota property: The resource amount quota.- Returns:
- the quota value.
-
setQuota
Set the quota property: The resource amount quota.- Parameters:
quota- the quota value to set.- Returns:
- the ResourceCounter object itself.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ResourceCounter>- Throws:
IOException
-
fromJson
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.
-