Package core.components.factories
Class ParkingSlotsFactory
- java.lang.Object
-
- core.components.factories.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 Summary
Constructors Constructor Description ParkingSlotsFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ParkingSlot
createElectricalBicycleSlot()
This methods creates an electrical bicycle parking slot and return the new instancestatic java.util.List<ParkingSlot>
createElectricalBicycleSlots(int numberOfBicycles)
This methods creates electrical parking slots (as a list) and return the new instancesstatic ParkingSlot
createFreeParkingSlot()
This methods create a free parking slot and return the new instancestatic java.util.List<ParkingSlot>
createFreeParkingSlots(int numberOfParkingSlots)
This methods creates free parking slots (as a list) and return the new instancesstatic ParkingSlot
createMechanicalBicycleSlot()
This methods creates a mechanical bicycle parking slot and return the new instancestatic java.util.List<ParkingSlot>
createMechanicalBicycleSlots(int numberOfBicycles)
This methods creates mechanical parking slots (as a list) and return the new instances
-
-
-
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
-
-