Class EliteLevel
java.lang.Object
org.deltava.beans.econ.EliteLevel
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<EliteLevel>
,Auditable
,ComboAlias
,EliteTotals
,RGBColor
,Cacheable
public class EliteLevel
extends Object
implements ComboAlias, EliteTotals, RGBColor, Auditable, Comparable<EliteLevel>, Cacheable
A bean to store Pilot loyalty status level definitions for a particular year.
- Since:
- 9.2
- Version:
- 11.5
- Author:
- Luke
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EliteLevel
A dummy, empty Elite level.static final int
The first year of the Elite program. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncacheKey()
Returns the cache key for this object.int
compareTo
(EliteLevel el2) boolean
Returns the object ID for this auditable object.float
Returns the bonus factor to be applied to points earned on a flight when the pilot is at this level.int
getColor()
Returns the RGB color.Returns the alias to use in the HTML <OPTION> element.Returns the visible name to use in the HTML <OPTION> element.int
Returns the total flight distance required for this level.boolean
Returns whether the level is visible.int
getLegs()
Returns the number of flight legs required for this level.getName()
Returns the level name.getOwner()
Returns the owner of this Elite Level.int
Returns the number of status points required for this level.Returns the last date of statistics used to generate thresholds.Returns the first date of statistics used to generate thresholds.int
Returns this level's target Pilot percentile.int
getYear()
Returns the year these requirements were in effect.int
hashCode()
boolean
matches
(EliteLevel el2) Utility method to compare names only between Elite Levels.static int
round
(float value, int rndTo) Rounds a leg or mileage number to the nearest factor.void
setBonusFactor
(float factor) Updates the bonus factor to be applied to points earned on a flight when the pilot is at this level.void
setColor
(int c) Updates the color used to display this level.void
setDistance
(int dst) Updates the total flight distance required for this level.void
setLegs
(int legs) Updates the number of flight legs required for this level.void
Updates the owner of this level.void
setPoints
(int pts) Updates the number of status points required for this level.void
Updates the first date of statistics used to generate thresholds.void
setTargetPercentile
(int pct) Updates this level's target Pilot percentile.void
setVisible
(boolean isVisible) Updates whether the level is visible.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.deltava.beans.Auditable
getAuditType, isCrossApp
Methods inherited from interface org.deltava.beans.econ.EliteTotals
isZero
Methods inherited from interface org.deltava.beans.RGBColor
getHexColor
-
Field Details
-
EMPTY
A dummy, empty Elite level. -
MIN_YEAR
public static final int MIN_YEARThe first year of the Elite program.- See Also:
-
-
Constructor Details
-
EliteLevel
-
-
Method Details
-
round
public static int round(float value, int rndTo) Rounds a leg or mileage number to the nearest factor.- Parameters:
value
- the valuerndTo
- the rounding factor- Returns:
- the rounded number
-
getName
-
getYear
public int getYear()Returns the year these requirements were in effect.- Returns:
- the year
-
getOwner
Returns the owner of this Elite Level.- Returns:
- the owner virtual airline code
-
getLegs
public int getLegs()Returns the number of flight legs required for this level.- Specified by:
getLegs
in interfaceEliteTotals
- Returns:
- the number of legs
-
getDistance
public int getDistance()Returns the total flight distance required for this level.- Specified by:
getDistance
in interfaceEliteTotals
- Returns:
- the number of miles
-
getPoints
public int getPoints()Returns the number of status points required for this level.- Specified by:
getPoints
in interfaceEliteTotals
- Returns:
- the number of points
-
getBonusFactor
public float getBonusFactor()Returns the bonus factor to be applied to points earned on a flight when the pilot is at this level.- Returns:
- the bonus factor
-
getColor
-
getTargetPercentile
public int getTargetPercentile()Returns this level's target Pilot percentile.- Returns:
- the percentile
-
getIsVisible
public boolean getIsVisible()Returns whether the level is visible.- Returns:
- TRUE if visible, otherwise FALSE
-
getStatisticsStartDate
Returns the first date of statistics used to generate thresholds.- Returns:
- the start date/time
-
getStatisticsEndDate
Returns the last date of statistics used to generate thresholds.- Returns:
- the end date/time
-
setLegs
public void setLegs(int legs) Updates the number of flight legs required for this level.- Parameters:
legs
- the number of legs
-
setDistance
public void setDistance(int dst) Updates the total flight distance required for this level.- Parameters:
dst
- the distance in miles
-
setOwner
Updates the owner of this level.- Parameters:
code
- the owner virtual airline code
-
setPoints
public void setPoints(int pts) Updates the number of status points required for this level.- Parameters:
pts
- the number of points
-
setBonusFactor
public void setBonusFactor(float factor) Updates the bonus factor to be applied to points earned on a flight when the pilot is at this level.- Parameters:
factor
- the bonus factor
-
setColor
public void setColor(int c) Updates the color used to display this level.- Parameters:
c
- the RGB code
-
setTargetPercentile
public void setTargetPercentile(int pct) Updates this level's target Pilot percentile.- Parameters:
pct
- the percentile
-
setVisible
public void setVisible(boolean isVisible) Updates whether the level is visible.- Parameters:
isVisible
- TRUE if visible, otherwise FALSE
-
setStatisticsStartDate
Updates the first date of statistics used to generate thresholds.- Parameters:
dt
- the start date/time
-
matches
Utility method to compare names only between Elite Levels. This is a rough cross-year equality test.- Parameters:
el2
- the second EliteLevel- Returns:
- TRUE if the names match, otherwise FALSE
-
getComboName
Description copied from interface:ComboAlias
Returns the visible name to use in the HTML <OPTION> element.- Specified by:
getComboName
in interfaceComboAlias
- Returns:
- The visible name for this entry
-
getComboAlias
Description copied from interface:ComboAlias
Returns the alias to use in the HTML <OPTION> element.- Specified by:
getComboAlias
in interfaceComboAlias
- Returns:
- The alias for this entry
-
getAuditID
Description copied from interface:Auditable
Returns the object ID for this auditable object.- Specified by:
getAuditID
in interfaceAuditable
- Returns:
- the ID
-
hashCode
-
equals
-
cacheKey
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<EliteLevel>
-