org.silverpeas.quota.model
Class Quota

java.lang.Object
  extended by org.silverpeas.quota.model.Quota
All Implemented Interfaces:
Serializable, Cloneable

@Entity
public class Quota
extends Object
implements Serializable, Cloneable

Author:
Yohann Chastagnier
See Also:
Serialized Form

Constructor Summary
Quota()
           
 
Method Summary
 Quota clone()
           
 boolean exists()
          Indicates if the quota is well registred
 long getCount()
           
 Long getId()
           
 QuotaLoad getLoad()
          Indicates by a basic way the load of the data
 BigDecimal getLoadPercentage()
          Calculates the load percentage of the quota rounded at two decimals
 BigDecimal getLoadRate()
          Calculates the load rate of the quota without rounded rounded at 20 decimals
 long getMaxCount()
           
 long getMinCount()
           
 String getResourceId()
           
 Date getSaveDate()
           
 QuotaType getType()
           
 boolean isReached()
          Indicates if the quota is reached or not
 void setCount(long count)
           
 void setId(Long id)
           
 void setMaxCount(long maxCount)
           
 void setMaxCount(String maxCount)
           
 void setMinCount(long minCount)
           
 void setMinCount(String minCount)
           
 void setResourceId(String resourceId)
           
 void setSaveDate(Date saveDate)
           
 void setType(QuotaType type)
           
 void setType(String type)
           
 String toString()
           
 void validate()
          Validates data
 void validateBounds()
          Validates count data
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Quota

public Quota()
Method Detail

exists

public boolean exists()
Indicates if the quota is well registred

Returns:

validate

public void validate()
              throws QuotaException
Validates data

Throws:
QuotaException

validateBounds

public void validateBounds()
                    throws QuotaException
Validates count data

Throws:
QuotaException

getLoad

public QuotaLoad getLoad()
Indicates by a basic way the load of the data

Returns:

isReached

public boolean isReached()
Indicates if the quota is reached or not

Returns:

getLoadRate

public BigDecimal getLoadRate()
Calculates the load rate of the quota without rounded rounded at 20 decimals

Returns:

getLoadPercentage

public BigDecimal getLoadPercentage()
Calculates the load percentage of the quota rounded at two decimals

Returns:

getId

public Long getId()
Returns:
the id

setId

public void setId(Long id)
Parameters:
id - the id to set

getType

public QuotaType getType()
Returns:
the type

setType

public void setType(QuotaType type)
Parameters:
type - the type to set

setType

public void setType(String type)
Parameters:
type - the type to set

getResourceId

public String getResourceId()
Returns:
the resourceId

setResourceId

public void setResourceId(String resourceId)
Parameters:
resourceId - the resourceId to set

getMinCount

public long getMinCount()
Returns:
the minCount

setMinCount

public void setMinCount(long minCount)
Parameters:
minCount - the minCount to set

setMinCount

public void setMinCount(String minCount)
                 throws QuotaException
Parameters:
minCount - the minCount to set
Throws:
QuotaException

getMaxCount

public long getMaxCount()
Returns:
the maxCount

setMaxCount

public void setMaxCount(long maxCount)
Parameters:
maxCount - the maxCount to set

setMaxCount

public void setMaxCount(String maxCount)
                 throws QuotaException
Parameters:
maxCount - the maxCount to set
Throws:
QuotaException

getCount

public long getCount()
Returns:
the count

setCount

public void setCount(long count)
Parameters:
count - the count to set

getSaveDate

public Date getSaveDate()
Returns:
the saveDate

setSaveDate

public void setSaveDate(Date saveDate)
Parameters:
saveDate - the saveDate to set

clone

public Quota clone()
Overrides:
clone in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2016 Silverpeas. All Rights Reserved.