Class UserFactory


  • public class UserFactory
    extends java.lang.Object
    The UserFactory class : This is the factory to create and add new users. We will always add users to a given system It is uses the simple factory design pattern
    • Constructor Summary

      Constructors 
      Constructor Description
      UserFactory()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Manager addManager​(MyVelibSystem system, java.lang.String name, int creditCardNumber)
      This method is responsible for adding a (new) manager to a system with some initial information.
      static Manager addManager​(MyVelibSystem system, java.lang.String name, java.awt.Point coordinate, int creditCardNumber, double money)
      This method is responsible for adding a (new) manager to a system with some initial information.
      static User addUser​(MyVelibSystem system, java.lang.String name, int creditCardNumber)
      This method is responsible for adding a (new) user to a system with some initial information.
      static User addUser​(MyVelibSystem system, java.lang.String name, java.awt.Point coordinate, int creditCardNumber, double money)
      This method is responsible for adding a (new) user to a system with some initial information.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UserFactory

        public UserFactory()
    • Method Detail

      • addUser

        public static User addUser​(MyVelibSystem system,
                                   java.lang.String name,
                                   java.awt.Point coordinate,
                                   int creditCardNumber,
                                   double money)
        This method is responsible for adding a (new) user to a system with some initial information.
        Parameters:
        system - the system that the user is requesting to be inserted in
        name - the name of the new user
        coordinate - the (initial) coordinate of the user
        creditCardNumber - the credit card number of the new user
        money - the (initial) money of the user in the application
        Returns:
        the User instance
      • addUser

        public static User addUser​(MyVelibSystem system,
                                   java.lang.String name,
                                   int creditCardNumber)
        This method is responsible for adding a (new) user to a system with some initial information. It can be simpler in some cases.
        Parameters:
        system - the system that the user is requesting to be inserted in
        name - the name of the new user
        creditCardNumber - the credit card number of the new user
        Returns:
        the User instance
      • addManager

        public static Manager addManager​(MyVelibSystem system,
                                         java.lang.String name,
                                         java.awt.Point coordinate,
                                         int creditCardNumber,
                                         double money)
        This method is responsible for adding a (new) manager to a system with some initial information.
        Parameters:
        system - the system that the user is requesting to be inserted in
        name - the name of the new user
        coordinate - the (initial) coordinate of the manager
        creditCardNumber - the credit card number of the new user
        money - the (initial) money of the user in the application
        Returns:
        the Manager instance
      • addManager

        public static Manager addManager​(MyVelibSystem system,
                                         java.lang.String name,
                                         int creditCardNumber)
        This method is responsible for adding a (new) manager to a system with some initial information. It can be simpler in some cases.
        Parameters:
        system - the system that the user is requesting to be inserted in
        name - the name of the new user
        creditCardNumber - the credit card number of the new manager
        Returns:
        the Manager instance