Class Accomplishment
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.stats.Accomplishment
- All Implemented Interfaces:
Serializable, Cloneable, Comparable<Object>, Auditable, ComboAlias, IDBean, RGBColor, ViewEntry, Cacheable
- Direct Known Subclasses:
DatedAccomplishment
public class Accomplishment
extends DatabaseBean
implements RGBColor, ComboAlias, Auditable, ViewEntry
A bean to define Pilot Accomplishments.
- Since:
- 3.2
- Version:
- 11.4
- Author:
- Luke
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAccomplishment(String name) Creates the bean.Creates an Accomplishment from a DatedAccomplishment -
Method Summary
Modifier and TypeMethodDescriptioncacheKey()Returns the cache key for this object.intbooleanbooleanReturns whether this Accomplishment is active.booleanReturns whether the Accomplishment should always display, even if the Pilot has achieved an accomplishment with the same Unit and a higher count.Returns the object ID for this auditable object.Returns the choices for this Accomplishment.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.getName()Returns the Accomplishment name.getOwner()Returns the owning Airline of this Accomplishment.intReturns the number of Pilots who have achieved this Accomplishment.Returns the CSS class for this object if rendered in a view table.getUnit()Returns the Accomplishment unit.intgetValue()Returns the Accomplishment value.inthashCode()booleanReturns whether this object is within multiple web applications.booleanrenameChoice(String oc, String nc) Renames one of the Accomplishment choices.voidsetActive(boolean isActive) Updates whether this Accomplishment is active.voidsetAlwaysDisplay(boolean show) Sets the Accomplishment to always display, even if the Pilot has achieved an accomplishment with the same Unit and a higher count.voidsetChoices(Collection<String> choices) Updates the choices for this Accomplishment.voidsetColor(int c) Updates the color used to display this Accomplishment.voidUpdates the accomplishment name.voidsetOwner(AirlineInformation info) Updates the Owner of this Accomplishment.voidsetPilots(int cnt) Updates the number of Pilots that have achieved this Accomplishment.voidUpdates the unit of measurement.voidsetValue(int value) Updates the number of units required for this Accomplishment.toString()Methods inherited from class DatabaseBean
getHexID, getID, setID, validateID, validateIDMethods inherited from interface Auditable
getAuditTypeMethods inherited from interface RGBColor
getHexColor
-
Constructor Details
-
Accomplishment
Creates the bean.- Parameters:
name- the accomplishment name- See Also:
-
Accomplishment
Creates an Accomplishment from a DatedAccomplishment- Parameters:
da- the DatedAccomplishment
-
-
Method Details
-
getName
-
getUnit
-
getValue
public int getValue()Returns the Accomplishment value.- Returns:
- the value
- See Also:
-
getColor
-
getActive
public boolean getActive()Returns whether this Accomplishment is active.- Returns:
- TRUE if active, otherwise FALSE
- See Also:
-
getAlwaysDisplay
public boolean getAlwaysDisplay()Returns whether the Accomplishment should always display, even if the Pilot has achieved an accomplishment with the same Unit and a higher count.- Returns:
- TRUE if the accomplishment should always be displayed if achieved, otherwise FALSE
-
getPilots
public int getPilots()Returns the number of Pilots who have achieved this Accomplishment.- Returns:
- the number of Pilots
- See Also:
-
getChoices
Returns the choices for this Accomplishment. This limits the possible values used to count towards this Accomplishment.- Returns:
- a Collection of Strings
-
getOwner
Returns the owning Airline of this Accomplishment.- Returns:
- the AirlineInformation bean for the owner Airline
- See Also:
-
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
-
setName
Updates the accomplishment name.- Parameters:
name- the accomplishment name- Throws:
NullPointerException- if name is null- See Also:
-
setUnit
Updates the unit of measurement.- Parameters:
u- the AccomplishUnit- See Also:
-
setValue
public void setValue(int value) Updates the number of units required for this Accomplishment.- Parameters:
value- the number of units- See Also:
-
setColor
public void setColor(int c) Updates the color used to display this Accomplishment.- Parameters:
c- the RGB code- See Also:
-
setActive
public void setActive(boolean isActive) Updates whether this Accomplishment is active.- Parameters:
isActive- TRUE if active, otherwise FALSE- See Also:
-
setAlwaysDisplay
public void setAlwaysDisplay(boolean show) Sets the Accomplishment to always display, even if the Pilot has achieved an accomplishment with the same Unit and a higher count.- Parameters:
show- TRUE if the accomplishment should always be displayed if achieved, otherwise FALSE
-
setOwner
Updates the Owner of this Accomplishment.- Parameters:
info- the AirlineInformation bean for the owner airline- See Also:
-
setPilots
public void setPilots(int cnt) Updates the number of Pilots that have achieved this Accomplishment.- Parameters:
cnt- the number of Pilots- See Also:
-
setChoices
Updates the choices for this Accomplishment.- Parameters:
choices- a Collection of strings
-
renameChoice
-
hashCode
public int hashCode()- Overrides:
hashCodein classDatabaseBean
-
toString
-
cacheKey
-
equals
- Overrides:
equalsin classDatabaseBean
-
getRowClassName
Description copied from interface:ViewEntryReturns the CSS class for this object if rendered in a view table.- Specified by:
getRowClassNamein interfaceViewEntry- Returns:
- the CSS class name, or NULL if none
-
compareTo
- Specified by:
compareToin interfaceComparable<Object>- Overrides:
compareToin classDatabaseBean
-
isCrossApp
public boolean isCrossApp()Description copied from interface:AuditableReturns whether this object is within multiple web applications. Objects where this is false will need additional data appended to the audit ID to prevent information leakage across applications where the audit IDs are identical between apps.- Specified by:
isCrossAppin interfaceAuditable- Returns:
- TRUE if cross-application, otherwise FALSE
-
getAuditID
Description copied from interface:AuditableReturns the object ID for this auditable object.- Specified by:
getAuditIDin interfaceAuditable- Returns:
- the ID
-