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 EliteLevelA dummy, empty Elite level.static final intThe first year of the Elite program. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncacheKey()Returns the cache key for this object.intcompareTo(EliteLevel el2) booleanReturns the object ID for this auditable object.floatReturns the bonus factor to be applied to points earned on a flight when the pilot is at this level.intgetColor()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.intReturns the total flight distance required for this level.booleanReturns whether the level is visible.intgetLegs()Returns the number of flight legs required for this level.getName()Returns the level name.getOwner()Returns the owner of this Elite Level.intReturns 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.intReturns this level's target Pilot percentile.intgetYear()Returns the year these requirements were in effect.inthashCode()booleanmatches(EliteLevel el2) Utility method to compare names only between Elite Levels.static intround(float value, int rndTo) Rounds a leg or mileage number to the nearest factor.voidsetBonusFactor(float factor) Updates the bonus factor to be applied to points earned on a flight when the pilot is at this level.voidsetColor(int c) Updates the color used to display this level.voidsetDistance(int dst) Updates the total flight distance required for this level.voidsetLegs(int legs) Updates the number of flight legs required for this level.voidUpdates the owner of this level.voidsetPoints(int pts) Updates the number of status points required for this level.voidUpdates the first date of statistics used to generate thresholds.voidsetTargetPercentile(int pct) Updates this level's target Pilot percentile.voidsetVisible(boolean isVisible) Updates whether the level is visible.toString()Methods inherited from interface Auditable
getAuditType, isCrossAppMethods inherited from interface EliteTotals
isZeroMethods inherited from interface 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:
getLegsin interfaceEliteTotals- Returns:
- the number of legs
-
getDistance
public int getDistance()Returns the total flight distance required for this level.- Specified by:
getDistancein interfaceEliteTotals- Returns:
- the number of miles
-
getPoints
public int getPoints()Returns the number of status points required for this level.- Specified by:
getPointsin 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:ComboAliasReturns the visible name to use in the HTML <OPTION> element.- Specified by:
getComboNamein interfaceComboAlias- Returns:
- The visible name for this entry
-
getComboAlias
Description copied from interface:ComboAliasReturns the alias to use in the HTML <OPTION> element.- Specified by:
getComboAliasin interfaceComboAlias- Returns:
- The alias for this entry
-
getAuditID
Description copied from interface:AuditableReturns the object ID for this auditable object.- Specified by:
getAuditIDin interfaceAuditable- Returns:
- the ID
-
hashCode
-
equals
-
cacheKey
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<EliteLevel>
-