Package at.jku.ssw.fp.airline
Class Flight
- java.lang.Object
-
- at.jku.ssw.fp.airline.Flight
-
public class Flight extends Object
Class representing a flight.- Author:
- Herbert Praehofer
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Indicates if this object is equal to the provided object.int
hashCode()
Returns the hash code.String
toString()
Returns a string representation of the flight
-
-
-
Field Detail
-
from
public final String from
The origin of the flight
-
to
public final String to
The destination of the flight
-
airline
public final Airline airline
The airline
-
flightNumber
public final String flightNumber
The flight number
-
departs
public final LocalDateTime departs
The date and time of the departure
-
price
public final int price
The price of the flight
-
-
Constructor Detail
-
Flight
public Flight(String from, String to, Airline airline, String flightNumber, LocalDateTime departs, int price)
Constructor creating a flight.- Parameters:
from
- the origin of the flightto
- the destination of the flightairline
- the airline of the flightflightNumber
- the number of the flightdeparts
- the departure date and time of the flightprice
- the price of the flight
-
-
Method Detail
-
hashCode
public int hashCode()
Returns the hash code.
-
equals
public boolean equals(Object obj)
Indicates if this object is equal to the provided object.
-
-