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