Class Airline

java.lang.Object
org.deltava.beans.schedule.Airline
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Airline>, Auditable, ComboAlias, ViewEntry, Cacheable

public class Airline extends Object implements ComboAlias, Auditable, Comparable<Airline>, Cacheable, ViewEntry
A class for storing Airline information.
Since:
1.0
Version:
11.2
Author:
Luke
See Also:
  • Constructor Details

    • Airline

      public Airline(String code, String name)
      Create a new Airline using a code and a name.
      Parameters:
      code - the Airline IATA code
      name - the Airline name
      Throws:
      NullPointerException - If either the name or the code are null
      See Also:
  • Method Details

    • getCode

      public String getCode()
      Returns the airline's IATA code.
      Returns:
      the IATA code
    • getICAO

      public String getICAO()
      Returns the airline's ICAO code.
      Returns:
      the ICAO code
      See Also:
    • getApplications

      public Collection<String> getApplications()
      Returns the web applications this airline is enabled for.
      Returns:
      a Collection of application codes
      See Also:
    • getCodes

      public Collection<String> getCodes()
      Returns all valid airline codes for this Airline.
      Returns:
      a Collection of Airline codes
      See Also:
    • getName

      public String getName()
      Returns the airline name.
      Returns:
      the airline name
      See Also:
    • getActive

      public boolean getActive()
      Returns if the airline is active.
      Returns:
      TRUE if the airline is enabled, otherwise FALSE
      See Also:
    • getHistoric

      public boolean getHistoric()
      Returns whether this is a historic airline.
      Returns:
      TRUE if historic, otherwise FALSE
      See Also:
    • getScheduleSync

      public boolean getScheduleSync()
      Returns if the schedules should be synchronized.
      Returns:
      TRUE if synchronized, otherwise FALSE
      See Also:
    • getColor

      public String getColor()
      The color to use then displaying this Airline's destinations or routes in a Google Map.
      Returns:
      the color name
      See Also:
    • setActive

      public void setActive(boolean active)
      Updates the airline's activity flag.
      Parameters:
      active - TRUE if the airline is enabled, otherwise FALSE
      See Also:
    • setICAO

      public void setICAO(String icao)
      Updates the airline's ICAO code.
      Parameters:
      icao - the ICAO code
      Throws:
      NullPointerException - if code is null
      See Also:
    • setHistoric

      public void setHistoric(boolean isHistoric)
      Updates whether this is a historic airline.
      Parameters:
      isHistoric - TRUE if historic, otherwise FALSE
      See Also:
    • setScheduleSync

      public void setScheduleSync(boolean sync)
      Updates whether the airline's schedules can be synchronized.
      Parameters:
      sync - TRUE if the schedules can be synchronized, otherwise FALSE
      See Also:
    • addApp

      public void addApp(String app)
      Adds a web application to this Airline.
      Parameters:
      app - the application code
      See Also:
    • setApps

      public void setApps(Collection<String> apps)
      Updates the web applications this Airline is enabled for.
      Parameters:
      apps - a Collection of application codes
      See Also:
    • addCode

      public void addCode(String code)
      Adds an alternate airline code to this Airline.
      Parameters:
      code - the airline code
      Throws:
      NullPointerException - if code is null
      See Also:
    • setCode

      public void setCode(String code)
      Updates the Airline's primary code.
      Parameters:
      code - the airline code
      Throws:
      NullPointerException - if code is null
      See Also:
    • setColor

      public void setColor(String color)
      Updates the color used when displaying this Airline's routes and destinations in a Google Map.
      Parameters:
      color - the color code
      Throws:
      IllegalArgumentException - if not a valid Google Map color
      See Also:
    • setCodes

      public void setCodes(Collection<String> codes)
      Clears and updates the list of alternate airline codes.
      Parameters:
      codes - a Collection of airline codes
      Throws:
      NullPointerException - if codes is null
      See Also:
    • getComboAlias

      public String getComboAlias()
      Description copied from interface: ComboAlias
      Returns the alias to use in the HTML <OPTION> element.
      Specified by:
      getComboAlias in interface ComboAlias
      Returns:
      The alias for this entry
    • getComboName

      public String getComboName()
      Description copied from interface: ComboAlias
      Returns the visible name to use in the HTML <OPTION> element.
      Specified by:
      getComboName in interface ComboAlias
      Returns:
      The visible name for this entry
    • setName

      public void setName(String name)
      Updates the airline name.
      Parameters:
      name - the Airline Name
      Throws:
      NullPointerException - if name is null
      See Also:
    • compareTo

      public int compareTo(Airline a2)
      Specified by:
      compareTo in interface Comparable<Airline>
    • equals

      public final boolean equals(Object o2)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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
      Returns:
      the cache key for the object
    • getAuditID

      public String getAuditID()
      Description copied from interface: Auditable
      Returns the object ID for this auditable object.
      Specified by:
      getAuditID in interface Auditable
      Returns:
      the ID
    • getRowClassName

      public String getRowClassName()
      Description copied from interface: ViewEntry
      Returns the CSS class for this object if rendered in a view table.
      Specified by:
      getRowClassName in interface ViewEntry
      Returns:
      the CSS class name, or NULL if none