Class AdministratorAdapter

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

public class AdministratorAdapter extends Object implements Userable
The class which adapts the some users operations defined in 'Userable' to connect them with administrative functions
  • Constructor Summary

    Constructors
    Constructor
    Description
    The constructor of the adapter which applies the Administrator using dependency injection
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    cancelRent(Rentable currentRent)
    The implemented method from the interface Userable which provides the administrator an ability to cancel an existing user's rent
    void
    editRent(Rentable currentRent)
    The implemented method from the interface Userable which provides the administrator an ability to edit a rent recently created by the user
    void
    payForRent(Rentable currentRent)
    The implmenented method from the interface Userable which implements payment process for the user
    rent(Liveable place)
    The implemented method from the interface Userable which implements renting the place for the user
    void
    The method which allows to set the specific user who will be serviced by the administrator

    Methods inherited from class java.lang.Object

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

    • AdministratorAdapter

      public AdministratorAdapter(Administrator administrator)
      The constructor of the adapter which applies the Administrator using dependency injection
      Parameters:
      administrator - - the administrator which will manage the system
  • Method Details

    • setUserToService

      public void setUserToService(Userable user)
      The method which allows to set the specific user who will be serviced by the administrator
      Parameters:
      user - , which are going to be serviced
    • rent

      public Rentable rent(Liveable place)
      The implemented method from the interface Userable which implements renting the place for the user
      Specified by:
      rent in interface Userable
      Parameters:
      place - - place, which will be rented for a while
      Returns:
      Rentable, which represents the rent of a user
      See Also:
    • payForRent

      public void payForRent(Rentable currentRent)
      The implmenented method from the interface Userable which implements payment process for the user
      Specified by:
      payForRent in interface Userable
      Parameters:
      currentRent - - Rentable, which represents the current rent bill of the user
    • cancelRent

      public void cancelRent(Rentable currentRent)
      The implemented method from the interface Userable which provides the administrator an ability to cancel an existing user's rent
      Specified by:
      cancelRent in interface Userable
      Parameters:
      currentRent - - Rentable, which represents an existing user's rent
    • editRent

      public void editRent(Rentable currentRent)
      The implemented method from the interface Userable which provides the administrator an ability to edit a rent recently created by the user
      Specified by:
      editRent in interface Userable
      Parameters:
      currentRent - - Rentable, which represents an existing user's rent