Class User

java.lang.Object
com.montytskyi.Userables.Implementations.User
All Implemented Interfaces:
Userable

public class User extends Object implements Userable
The class 'User' implements interface 'Userable' in order to implement the logic of managing users' rents in the dormitory
  • Constructor Details

    • User

      public User()
      The empty constructor of a class
    • User

      public User(String name, String surname, String phoneNumber, String email)
      The constructor which receives all parameters possible
      Parameters:
      name - - the name of the user
      surname - - the surname of the user
      phoneNumber - - the phone number of the user
      email - - the email of the user
  • Method Details

    • rent

      public Rentable rent(Liveable place)
      The method implemented from the interface 'Userable' which goal is to rent the place for the user
      Specified by:
      rent in interface Userable
      Parameters:
      place - - the place which will be rented by the user
      Returns:
      Returns the rent which consists the user information and the data about the place it's rented
      See Also:
    • payForRent

      public void payForRent(Rentable currentRent)
      The method implemented from the interface 'Userable' which goal is to provide a payment for the rent
      Specified by:
      payForRent in interface Userable
      Parameters:
      currentRent - - receives a created rent where user becomes provided with the ability to pay for the rent
    • cancelRent

      public void cancelRent(Rentable currentRent)
      The method implemented from the interface 'Userable' which goal is to cancel user's existing rent
      Specified by:
      cancelRent in interface Userable
      Parameters:
      currentRent - - receives an existing user's rent which has been recently created
    • editRent

      public void editRent(Rentable currentRent)
      The method implemented from the interface 'Userable' which goal is to edit existing user's rent
      Specified by:
      editRent in interface Userable
      Parameters:
      currentRent - - receives an existing user's rent which has been recently created
    • getName

      public String getName()
      The getter method for the user's name
      Returns:
      a User's name
    • setName

      public void setName(String name)
      The setter for the user's name
      Parameters:
      name - - the name of the user
    • getSurname

      public String getSurname()
      The getter for user's surname
      Returns:
      the User's surname
    • setSurname

      public void setSurname(String surname)
      The setter method for user's surname
      Parameters:
      surname - - The user's surname
    • getPhoneNumber

      public String getPhoneNumber()
      The getter method for user's phone number
      Returns:
      the User's phone number
    • setPhoneNumber

      public void setPhoneNumber(String phoneNumber)
      The setter method for user's phone number
      Parameters:
      phoneNumber - - the user's phone number
    • getEmail

      public String getEmail()
      The getter for user's email
      Returns:
      the user's email
    • setEmail

      public void setEmail(String email)
      The setter method for user's email