java.lang.Object
com.prog3.ipt.Model.TravelDocumentClasses.TravelDocumentFactory
- Direct Known Subclasses:
MembershipConcreteFactory
,SingleTicketConcreteFactory
TravelDocumentFactory is an abstract class, created to implement Factory Method design pattern.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract TravelDocument
createTravelDocument
(double price, LocalDate issueDate, LocalDate expirationDate, String transactionID, String lineID, String rideID, LocalDate stampDate, LocalDate startDate) Returns a TravelDocument object
-
Constructor Details
-
TravelDocumentFactory
public TravelDocumentFactory()
-
-
Method Details
-
createTravelDocument
public abstract TravelDocument createTravelDocument(double price, LocalDate issueDate, LocalDate expirationDate, String transactionID, String lineID, String rideID, LocalDate stampDate, LocalDate startDate) Returns a TravelDocument object- Parameters:
price
- The price of the travel documentissueDate
- The issue date of the travel documentexpirationDate
- The date of expire of the travel documenttransactionID
- The unique identifier of the transaction which contains travel documents bought by the citizenlineID
- The unique identifier of the line if the travel document is a single ticketrideID
- The unique identifier of the ride if the travel document is a single ticketstampDate
- The stamp date of the travel document, in particular a single ticketstartDate
- The validity start date of the travel document if it is a membership- Returns:
- A reference to a TravelDocument object
-