Class TravelDocumentFactory

java.lang.Object
com.prog3.ipt.Model.TravelDocumentClasses.TravelDocumentFactory
Direct Known Subclasses:
MembershipConcreteFactory, SingleTicketConcreteFactory

public abstract class TravelDocumentFactory extends Object
TravelDocumentFactory is an abstract class, created to implement Factory Method design pattern.
  • 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 document
      issueDate - The issue date of the travel document
      expirationDate - The date of expire of the travel document
      transactionID - The unique identifier of the transaction which contains travel documents bought by the citizen
      lineID - The unique identifier of the line if the travel document is a single ticket
      rideID - The unique identifier of the ride if the travel document is a single ticket
      stampDate - The stamp date of the travel document, in particular a single ticket
      startDate - The validity start date of the travel document if it is a membership
      Returns:
      A reference to a TravelDocument object