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 Details

    • 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 Details

    • QuotaIndex

      QuotaIndex()
    • QuotaIndex

      public QuotaIndex​(QuotaTypeData quotaType, int location)
  • 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

      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
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals​(Object o)
      Check if this object is equal to another QuotaIndex object. They are equal if both have the same quotatype id and location.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Calculate the hash code for the object.
      Overrides:
      hashCode in class Object
    • readObject

      private void readObject​(ObjectInputStream ois) throws ClassNotFoundException, IOException
      Throws:
      ClassNotFoundException
      IOException
    • writeObject

      private void writeObject​(ObjectOutputStream ois) throws IOException
      Throws:
      IOException