Class Membership

java.lang.Object
com.prog3.ipt.Model.TravelDocumentClasses.TravelDocument
com.prog3.ipt.Model.TravelDocumentClasses.Membership

public class Membership extends TravelDocument
Membership is a class that extends TravelDocument abstract class
  • Field Details

  • Constructor Details

    • Membership

      public Membership(double price, LocalDate issueDate, LocalDate expirationDate, String transactionID, LocalDate startDate)
      Membership constructor
      Parameters:
      price - The price of the membership
      issueDate - The issue date of the membership
      expirationDate - The date of expire of the membership
      transactionID - The unique identifier of the transaction which contains travel documents bought by the citizen
      startDate - The validity start date of the membership
  • Method Details

    • setStartDate

      private void setStartDate(LocalDate startDate)
    • getStartDate

      public LocalDate getStartDate()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class TravelDocument
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class TravelDocument
    • toString

      public String toString()
      Overrides:
      toString in class TravelDocument
    • toTravelDocumentFX

      public TravelDocumentFX toTravelDocumentFX()
      Produces a Membership object according to the TravelDocumentFX object calling this method
      Overrides:
      toTravelDocumentFX in class TravelDocument
      Returns:
      A reference to a TravelDocumentFX object
    • updateTravelDocument

      public void updateTravelDocument(double price, LocalDate issueDate, LocalDate expirationDate, String transactionID, String lineID, String rideID, LocalDate stampDate, LocalDate startDate)
      Updates Membership object according to new parameters
      Specified by:
      updateTravelDocument in class TravelDocument
      Parameters:
      price - The price of the membership
      issueDate - The issue date of the membership
      expirationDate - The date of expire of the membership
      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 single ticket
      startDate - The validity start date of the membership