Package com.uca.flights

## Class AirportId

- java.lang.Object
- - com.uca.flights.AirportId

All Implemented Interfaces:
  `java.lang.Comparable<AirportId>`

    public class AirportId
    extends java.lang.Object
    implements java.lang.Comparable<AirportId>

Represent an airport identifier, a 3 letter code

### Constructor Summary

Constructors
`AirportId​(java.lang.String value)` Constructor

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `compareTo​(AirportId other)` Redefinition of compareTo
`boolean` `equals​(java.lang.Object other)` Redefinition of equals
`java.lang.String` `getValue()` Getter
`int` `hashCode()` Redefinition of hashCode
`int` `length()` Getter
`java.lang.String` `toString()` Redefinition of toString

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### AirportId

    public AirportId​(java.lang.String value)

Constructor

Parameters:
  `value` - the airport id value
Throws:
  `java.lang.IllegalArgumentException` - on null or wrong length parameter

### Method Detail

#### getValue

    public java.lang.String getValue()

Getter

Returns:
  airport id value

#### length

    public int length()

Getter

Returns:
  airport length (always equals 3)

#### toString

    public java.lang.String toString()

Redefinition of toString

Overrides:
  `toString` in class `java.lang.Object`
Returns:
  the value of the airport id

#### compareTo

    public int compareTo​(AirportId other)

Redefinition of compareTo

Specified by:
  `compareTo` in interface `java.lang.Comparable<AirportId>`
Parameters:
  `other` - the airportId 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 airportId to compare to
Returns:
  true if other has the same value, false else
Throws:
  `java.lang.IllegalArgumentException` - on null or not AirportId parameter

#### hashCode

    public int hashCode()

Redefinition of hashCode

Overrides:
  `hashCode` in class `java.lang.Object`
Returns:
  the hashcode