Ejemplo n.º 1
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + deadline.hashCode();
   result = prime * result + description.hashCode();
   result = prime * result + ((estimatedTime == null) ? 0 : estimatedTime.hashCode());
   result = prime * result + garageholder.hashCode();
   result = prime * result + orderTime.hashCode();
   result = prime * result + pendingCars;
   result = prime * result + quantity;
   return result;
 }
Ejemplo n.º 2
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;
    IOrder other = null;
    try {
      other = (IOrder) obj;
    } catch (ClassCastException e) {
      return false;
    }
    if (!description.equals(other.getDescription())) return false;

    if (!deadline.equals(other.getDeadline())) return false;

    if (estimatedTime == null) {
      if (other.getEstimatedTime() != null) return false;
    } else if (!estimatedTime.equals(other.getEstimatedTime())) return false;
    if (!garageholder.equals(other.getGarageHolder())) return false;
    if (!orderTime.equals(other.getOrderTime())) return false;
    if (pendingCars != other.getPendingCars()) return false;
    if (quantity != other.getQuantity()) return false;
    return true;
  }