Beispiel #1
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((aircraft == null) ? 0 : aircraft.hashCode());
   result = prime * result + ((bookingId == null) ? 0 : bookingId.hashCode());
   result = prime * result + ((end == null) ? 0 : end.hashCode());
   result = prime * result + ((pilot == null) ? 0 : pilot.hashCode());
   result = prime * result + ((start == null) ? 0 : start.hashCode());
   return result;
 }
Beispiel #2
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) {
     return true;
   }
   if (obj == null) {
     return false;
   }
   if (getClass() != obj.getClass()) {
     return false;
   }
   Booking other = (Booking) obj;
   if (aircraft == null) {
     if (other.aircraft != null) {
       return false;
     }
   } else if (!aircraft.equals(other.aircraft)) {
     return false;
   }
   if (bookingId == null) {
     if (other.bookingId != null) {
       return false;
     }
   } else if (!bookingId.equals(other.bookingId)) {
     return false;
   }
   if (end == null) {
     if (other.end != null) {
       return false;
     }
   } else if (!dateEquals(end, other.end)) {
     return false;
   }
   if (pilot == null) {
     if (other.pilot != null) {
       return false;
     }
   } else if (!pilot.equals(other.pilot)) {
     return false;
   }
   if (start == null) {
     if (other.start != null) {
       return false;
     }
   } else if (!dateEquals(start, other.start)) {
     return false;
   }
   return true;
 }