Package net.sf.basedb.core.data
Class QuotaIndex
java.lang.Object
net.sf.basedb.core.data.QuotaIndex
- All Implemented Interfaces:
Serializable
public class QuotaIndex extends Object implements Serializable
This is a helper class for the
QuotaData
item to
help with the Hibernate mapping between quota and
quota type/location/max bytes. This class holds quota type/location
pairs used as keys in the QuotaData.getQuotaValues()
map.- Version:
- 2.0
- Author:
- enell
- See Also:
- Developer documentation: Quota and disk usage, Serialized Form
- Last modified
- $Date: 2016-05-23 12:47:45 +0200 (må, 23 maj 2016) $
-
Field Summary
Fields Modifier and Type Field Description private int
location
private long
maxBytes
private QuotaTypeData
quotaType
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description QuotaIndex()
QuotaIndex(QuotaTypeData quotaType, int location)
-
Method Summary
Modifier and Type Method Description boolean
equals(Object o)
Check if this object is equal to anotherQuotaIndex
object.QuotaIndex
find(Set<QuotaIndex> quota)
Find the quota entry in the given set that correpsonds to the same quota type and location as this index.Long
findMaxBytes(Set<QuotaIndex> quota)
Find the quota index entry in the given set and return the 'maxBytes' value.int
getLocation()
long
getMaxBytes()
(package private) QuotaTypeData
getQuotaType()
int
hashCode()
Calculate the hash code for the object.private void
readObject(ObjectInputStream ois)
(package private) void
setLocation(int location)
void
setMaxBytes(long maxBytes)
(package private) void
setQuotaType(QuotaTypeData quotaType)
String
toString()
private void
writeObject(ObjectOutputStream ois)
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
- Constant Field Values
-
location
private int location -
quotaType
-
maxBytes
private long maxBytes
-
-
Constructor Details
-
QuotaIndex
QuotaIndex() -
QuotaIndex
-
-
Method Details
-
getLocation
public int getLocation()- Hibernate: property
- column="`location`" type="int"
-
setLocation
void setLocation(int location) -
getQuotaType
QuotaTypeData getQuotaType()- Hibernate: many-to-one
- column="`quotaType_id`" outer-join="false"
-
setQuotaType
-
getMaxBytes
public long getMaxBytes()- Hibernate: property
- column="`max_bytes`" type="long"
-
setMaxBytes
public void setMaxBytes(long maxBytes) -
findMaxBytes
Find the quota index entry in the given set and return the 'maxBytes' value. NOTE! Used to be stored in a Map, but due to changes between Hibernate 3 and Hibernate 4 this seems to no longer work and we need to do it like this instead.- Since:
- 3.4
-
find
Find the quota entry in the given set that correpsonds to the same quota type and location as this index.- Since:
- 3.9
-
toString
-
equals
Check if this object is equal to anotherQuotaIndex
object. They are equal if both have the same quotatype id and location. -
hashCode
public int hashCode()Calculate the hash code for the object. -
readObject
- Throws:
ClassNotFoundException
IOException
-
writeObject
- Throws:
IOException
-