Class FlightId

  • All Implemented Interfaces:
    java.lang.Comparable<FlightId>

    public class FlightId
    extends java.lang.Object
    implements java.lang.Comparable<FlightId>
    Represent a flight identifier, the prefix of the company plus an integer on 4 digits
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(FlightId other)
      Redefinition of compareTo
      boolean equals​(java.lang.Object other)
      Redefinition of equals
      java.lang.String getValue()
      Getter
      int hashCode()
      Redefinition of hashCode
      java.lang.String toString()
      Redefinition of toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getValue

        public java.lang.String getValue()
        Getter
        Returns:
        flight id value
      • toString

        public java.lang.String toString()
        Redefinition of toString
        Overrides:
        toString in class java.lang.Object
        Returns:
        the value of the flight id
      • compareTo

        public int compareTo​(FlightId other)
        Redefinition of compareTo
        Specified by:
        compareTo in interface java.lang.Comparable<FlightId>
        Parameters:
        other - the FlightId to compare to
        Returns:
        0 if other has the same value, 1 else
        Throws:
        java.lang.IllegalArgumentException - on null parameter
      • equals

        public boolean equals​(java.lang.Object other)
        Redefinition of equals
        Overrides:
        equals in class java.lang.Object
        Parameters:
        other - the FlightId to compare to
        Returns:
        true if other has the same value, false else
        Throws:
        java.lang.IllegalArgumentException - on null or not FlightId parameter
      • hashCode

        public int hashCode()
        Redefinition of hashCode
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hashcode