Class EliteStatus

java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.econ.EliteStatus
All Implemented Interfaces:
Serializable, Comparable<Object>, EliteLevelBean, IDBean, RGBColor, Cacheable
Direct Known Subclasses:
LifetimeStatus

public class EliteStatus extends DatabaseBean implements EliteLevelBean
A bean to store Pilots' Elite status level data.
Since:
9.2
Version:
11.5
Author:
Luke
See Also:
  • Constructor Details

    • EliteStatus

      public EliteStatus(int pilotID, EliteLevel lvl)
      Creates the bean.
      Parameters:
      pilotID - the Pilot's database ID
      lvl - the EliteLevel
  • Method Details

    • getLevel

      public EliteLevel getLevel()
      Description copied from interface: EliteLevelBean
      Returns the Elite status level.
      Specified by:
      getLevel in interface EliteLevelBean
      Returns:
      the EliteLevel
    • getColor

      public int getColor()
      Description copied from interface: RGBColor
      Returns the RGB color.
      Specified by:
      getColor in interface RGBColor
      Returns:
      a 24-bit RGB color value
    • getEffectiveOn

      public Instant getEffectiveOn()
      Returns the effective date of this status.
      Returns:
      the effective date
    • getUpgradeReason

      public UpgradeReason getUpgradeReason()
      Returns the reason for this status upgrade.
      Returns:
      an UpgradeReason
    • getIsLifetime

      public boolean getIsLifetime()
      Returns whether this is a lifetime status.
      Returns:
      TRUE if a lifetime status, otherwise FALSE
    • setEffectiveOn

      public void setEffectiveOn(Instant dt)
      Returns the effective date of this status.
      Parameters:
      dt - the effective date
    • setUpgradeReason

      public void setUpgradeReason(UpgradeReason ur)
      Updates the reason for this status upgrade.
      Parameters:
      ur - an UpgradeReason
    • setLevel

      public void setLevel(EliteLevel lvl)
      Description copied from interface: EliteLevelBean
      Updates the Elite status level.
      Specified by:
      setLevel in interface EliteLevelBean
      Parameters:
      lvl - the EliteLevel
    • generateKey

      public static Long generateKey(int year, int id)
      Generates the cache key for this type of bean.
      Parameters:
      year - the plan year
      id - the pilot's database ID
      Returns:
      the cache key
    • cacheKey

      public Object cacheKey()
      Description copied from interface: Cacheable
      Returns the cache key for this object. Caches call this method when adding the object.
      Specified by:
      cacheKey in interface Cacheable
      Overrides:
      cacheKey in class DatabaseBean
      Returns:
      the cache key for the object
    • toString

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

      public int compareTo(Object o2)
      Specified by:
      compareTo in interface Comparable<Object>
      Overrides:
      compareTo in class DatabaseBean