Ejemplo n.º 1
0
 /**
  * The method checks the object to <code>null</code> completeness of all positions are empty
  * positions are not allowed
  *
  * @param flight - Flight object being checked
  * @return - false, if everything checks out correctly; true - if the data is invalid
  */
 private static boolean checkEmpty(Flight flight) {
   return flight == null
       || flight.getDate() == null
       || flight.getFrom() == null
       || flight.getTo() == null
       || flight.getPlane() == null;
 }
Ejemplo n.º 2
0
 /**
  * The method checks the place of departure and place of arrival, they will not be the same
  *
  * @param flight - Flight object being checked
  * @return - false, if everything checks out correctly; true - if the data is invalid
  */
 private static boolean checkEntry(Flight flight) {
   return flight.getFrom().equals(flight.getTo());
 }