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.int
boolean
boolean
Returns whether this Accomplishment is active.boolean
Returns 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.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.getName()
Returns the Accomplishment name.getOwner()
Returns the owning Airline of this Accomplishment.int
Returns 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.int
getValue()
Returns the Accomplishment value.int
hashCode()
boolean
Returns whether this object is within multiple web applications.boolean
renameChoice
(String oc, String nc) Renames one of the Accomplishment choices.void
setActive
(boolean isActive) Updates whether this Accomplishment is active.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.void
setChoices
(Collection<String> choices) Updates the choices for this Accomplishment.void
setColor
(int c) Updates the color used to display this Accomplishment.void
Updates the accomplishment name.void
setOwner
(AirlineInformation info) Updates the Owner of this Accomplishment.void
setPilots
(int cnt) Updates the number of Pilots that have achieved this Accomplishment.void
Updates the unit of measurement.void
setValue
(int value) Updates the number of units required for this Accomplishment.toString()
Methods inherited from class org.deltava.beans.DatabaseBean
getHexID, getID, setID, validateID, validateID
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.deltava.beans.Auditable
getAuditType
Methods inherited from interface org.deltava.beans.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: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
-
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:
hashCode
in classDatabaseBean
-
toString
-
cacheKey
-
equals
- Overrides:
equals
in classDatabaseBean
-
getRowClassName
Description copied from interface:ViewEntry
Returns the CSS class for this object if rendered in a view table.- Specified by:
getRowClassName
in interfaceViewEntry
- Returns:
- the CSS class name, or NULL if none
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Object>
- Overrides:
compareTo
in classDatabaseBean
-
isCrossApp
public boolean isCrossApp()Description copied from interface:Auditable
Returns 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:
isCrossApp
in interfaceAuditable
- Returns:
- TRUE if cross-application, otherwise FALSE
-
getAuditID
Description copied from interface:Auditable
Returns the object ID for this auditable object.- Specified by:
getAuditID
in interfaceAuditable
- Returns:
- the ID
-