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 theQuotaData
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 theQuotaData.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
All Methods Instance Methods Concrete Methods 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 Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
location
private int location
-
quotaType
private transient QuotaTypeData quotaType
-
maxBytes
private long maxBytes
-
-
Constructor Detail
-
QuotaIndex
QuotaIndex()
-
QuotaIndex
public QuotaIndex(QuotaTypeData quotaType, int location)
-
-
Method Detail
-
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
void setQuotaType(QuotaTypeData quotaType)
-
getMaxBytes
public long getMaxBytes()
- Hibernate: property
- column="`max_bytes`" type="long"
-
setMaxBytes
public void setMaxBytes(long maxBytes)
-
findMaxBytes
public Long findMaxBytes(Set<QuotaIndex> quota)
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
public 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.- Since:
- 3.9
-
equals
public boolean equals(Object o)
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
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException
- Throws:
ClassNotFoundException
IOException
-
writeObject
private void writeObject(ObjectOutputStream ois) throws IOException
- Throws:
IOException
-
-