cleanup
This commit is contained in:
@@ -30,21 +30,20 @@ public final class CabinReservation extends Reservation {
|
||||
physical_address.getZip()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String ReservationType() {
|
||||
return "CabinReservation";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkValid() throws IllegalArgumentException {
|
||||
boolean result = false;
|
||||
if (getPhysical_address() == null) {
|
||||
throw new IllegalArgumentException(String.format("not valid, physical_address %s", this.getReservation_number()));
|
||||
}
|
||||
if (getMailing_address() == null) {
|
||||
throw new IllegalArgumentException(String.format("not valid, mailing_address: %s", this.getReservation_number()));
|
||||
}
|
||||
result = true;
|
||||
return result;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,7 +50,6 @@ public final class HotelReservation extends Reservation{
|
||||
|
||||
@Override
|
||||
public boolean checkValid() throws IllegalArgumentException {
|
||||
boolean result = false;
|
||||
if (getNumberOfBathRooms() != 1) {
|
||||
throw new IllegalArgumentException("not valid, Baths");
|
||||
}
|
||||
@@ -66,8 +65,7 @@ public final class HotelReservation extends Reservation{
|
||||
if (getMailing_address() == null) {
|
||||
throw new IllegalArgumentException(String.format("not valid, mailing_address: %s", this.getReservation_number()));
|
||||
}
|
||||
result = true;
|
||||
return result;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -47,15 +47,13 @@ public final class HouseReservation extends Reservation {
|
||||
|
||||
@Override
|
||||
public boolean checkValid() throws IllegalArgumentException {
|
||||
boolean result = false;
|
||||
if (getPhysical_address() == null) {
|
||||
throw new IllegalArgumentException(String.format("not valid, physical_address %s", this.getReservation_number()));
|
||||
}
|
||||
if (getMailing_address() == null) {
|
||||
throw new IllegalArgumentException(String.format("not valid, mailing_address: %s", this.getReservation_number()));
|
||||
}
|
||||
result = true;
|
||||
return result;
|
||||
return true;
|
||||
}
|
||||
|
||||
// House price plus additional flat fee for additional space per day
|
||||
|
||||
Reference in New Issue
Block a user