public final class Quota
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Quota.Type
Quota.Type - The quota resource type |
| Modifier and Type | Field and Description |
|---|---|
static int |
UNLIMITED
Constant which indicates unlimited quota
|
| Constructor and Description |
|---|
Quota(long limit,
long usage,
Quota.Type type)
Initializes a new
Quota |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
long |
getLimit()
Gets the limit
|
Quota.Type |
getType()
Gets the quota's resource type to which this quota limitation applies
|
static Quota |
getUnlimitedQuota(Quota.Type type)
Gets constant for unlimited quota for specified resource type
This is a convenience method that invokes
Quota.Type.getUnlimited() for specified instance of Quota.Type. |
static Quota[] |
getUnlimitedQuotas(Quota.Type[] types)
Gets constants for unlimited quota for specified resource types
This is a convenience method that invokes
Quota.Type.getUnlimited() for each type in given array of Quota.Type. |
long |
getUsage()
Gets the usage
|
int |
hashCode() |
long[] |
toLongArray()
Returns a newly created array of
long from this quota's limit and usage values. |
java.lang.String |
toString() |
public static final int UNLIMITED
public Quota(long limit,
long usage,
Quota.Type type)
Quotalimit - The quota's limitusage - The quota's usagetype - The quota's resource type to which this quota limitation appliespublic static Quota getUnlimitedQuota(Quota.Type type)
This is a convenience method that invokes Quota.Type.getUnlimited() for specified instance of Quota.Type.
type - The resource typepublic static Quota[] getUnlimitedQuotas(Quota.Type[] types)
This is a convenience method that invokes Quota.Type.getUnlimited() for each type in given array of Quota.Type.
types - The resource typespublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic long getLimit()
public long getUsage()
public Quota.Type getType()
public long[] toLongArray()
long from this quota's limit and usage values. Quota's limit is at index 0
and its usage is located at index 1.long from this quota's limit and usage.public java.lang.String toString()
toString in class java.lang.Object