Freigeben über


ResourceCounter Class

  • java.lang.Object
    • com.azure.search.documents.indexes.models.ResourceCounter

Implements

public final class ResourceCounter
implements JsonSerializable<ResourceCounter>

Represents a resource's usage and quota.

Constructor Summary

Constructor Description
ResourceCounter(long usage)

Creates an instance of ResourceCounter class.

Method Summary

Modifier and Type Method and Description
static ResourceCounter fromJson(JsonReader jsonReader)

Reads an instance of ResourceCounter from the JsonReader.

Long getQuota()

Get the quota property: The resource amount quota.

long getUsage()

Get the usage property: The resource usage amount.

ResourceCounter setQuota(Long quota)

Set the quota property: The resource amount quota.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

ResourceCounter

public ResourceCounter(long usage)

Creates an instance of ResourceCounter class.

Parameters:

usage - the usage value to set.

Method Details

fromJson

public static ResourceCounter fromJson(JsonReader jsonReader)

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:

IOException

- If the deserialized JSON object was missing any required properties.

getQuota

public Long getQuota()

Get the quota property: The resource amount quota.

Returns:

the quota value.

getUsage

public long getUsage()

Get the usage property: The resource usage amount.

Returns:

the usage 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 JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to