Class ParkingSlotsFactory


  • public class ParkingSlotsFactory
    extends java.lang.Object
    The ParkingSlotFactory class : This is the factory to create and add new parking slots to stations It is uses the simple factory design pattern
    • Constructor Detail

      • ParkingSlotsFactory

        public ParkingSlotsFactory()
    • Method Detail

      • createFreeParkingSlots

        public static java.util.List<ParkingSlot> createFreeParkingSlots​(int numberOfParkingSlots)
        This methods creates free parking slots (as a list) and return the new instances
        Parameters:
        numberOfParkingSlots - the quantity of parking slots that we need
        Returns:
        a list of free parking slots
      • createFreeParkingSlot

        public static ParkingSlot createFreeParkingSlot()
        This methods create a free parking slot and return the new instance
        Returns:
        a free parking slot instance
      • createElectricalBicycleSlot

        public static ParkingSlot createElectricalBicycleSlot()
        This methods creates an electrical bicycle parking slot and return the new instance
        Returns:
        an electrical bicycle slot instance
      • createElectricalBicycleSlots

        public static java.util.List<ParkingSlot> createElectricalBicycleSlots​(int numberOfBicycles)
        This methods creates electrical parking slots (as a list) and return the new instances
        Parameters:
        numberOfBicycles - the quantity of parking slots that we need
        Returns:
        a list of electrical parking slots
      • createMechanicalBicycleSlot

        public static ParkingSlot createMechanicalBicycleSlot()
        This methods creates a mechanical bicycle parking slot and return the new instance
        Returns:
        an electrical bicycle slot instance
      • createMechanicalBicycleSlots

        public static java.util.List<ParkingSlot> createMechanicalBicycleSlots​(int numberOfBicycles)
        This methods creates mechanical parking slots (as a list) and return the new instances
        Parameters:
        numberOfBicycles - the quantity of parking slots that we need
        Returns:
        a list of mechanical parking slots