Class DirectorHandler
java.lang.Object
com.university.bookstore.chain.DiscountHandler
com.university.bookstore.chain.DirectorHandler
Director-level discount approval handler.
Can approve discounts up to 25%.
- Since:
- 2024-09-15
- Version:
- 3.0
- Author:
- Navid Mohaghegh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the name of this handler for identification purposes.doubleGets the maximum discount this handler can approve.voidhandleRequest(DiscountRequest request) Handles a discount request.Methods inherited from class com.university.bookstore.chain.DiscountHandler
canApprove, getChainLength, getHandlerInfo, getNext, setNext, toString
-
Constructor Details
-
DirectorHandler
public DirectorHandler()
-
-
Method Details
-
handleRequest
Description copied from class:DiscountHandlerHandles a discount request. Subclasses must implement this method to define their approval logic.- Specified by:
handleRequestin classDiscountHandler- Parameters:
request- the discount request to handle
-
getHandlerName
Description copied from class:DiscountHandlerGets the name of this handler for identification purposes.- Specified by:
getHandlerNamein classDiscountHandler- Returns:
- the handler name
-
getMaxDiscount
public double getMaxDiscount()Description copied from class:DiscountHandlerGets the maximum discount this handler can approve.- Specified by:
getMaxDiscountin classDiscountHandler- Returns:
- the maximum discount rate (0.0 to 1.0)
-