This commit is contained in:
2025-09-23 17:21:41 -04:00
parent 7c3ea29d60
commit 3bf2434a69
3 changed files with 4 additions and 9 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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