Class Equipment
java.lang.Object
com.equipmentrental.equipment_rental_system.model.Equipment
Represents a physical equipment item available for booking.
This is the central entity in the system: it is categorised, booked and tracked.
Each item belongs to exactly one Category (BR-04) and can have
multiple Booking records. The EquipmentStatus reflects the
current availability and is updated automatically when bookings are created
or cancelled (BR-08).
Equipment with active bookings cannot be deleted (BR-07). Items in MAINTENANCE or UNAVAILABLE status cannot be booked (BR-01).
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEquipment(String name, String description, String location, String condition, EquipmentStatus status, LocalDate purchaseDate, BigDecimal costPerDay, Category category) Creates a new equipment item with all fields. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether this equipment item has AVAILABLE status.voidupdateStatus(EquipmentStatus newStatus) Updates the equipment status to the specified value.
-
Constructor Details
-
Equipment
public Equipment(String name, String description, String location, String condition, EquipmentStatus status, LocalDate purchaseDate, BigDecimal costPerDay, Category category) Creates a new equipment item with all fields.- Parameters:
name- display name of the itemdescription- brief descriptionlocation- physical storage locationcondition- current physical condition (e.g. Good, Fair, Excellent)status- availability statuspurchaseDate- date the item was acquiredcostPerDay- daily booking cost in pounds sterlingcategory- the category this item belongs to
-
-
Method Details
-
isAvailable
public boolean isAvailable()Checks whether this equipment item has AVAILABLE status.- Returns:
trueif the status isEquipmentStatus.AVAILABLE
-
updateStatus
Updates the equipment status to the specified value.- Parameters:
newStatus- the new status to set
-