Package notification

Class SmsCommunication

java.lang.Object
notification.SmsCommunication
All Implemented Interfaces:
CommunicationStrategy

class SmsCommunication extends Object implements CommunicationStrategy
This is a subclass of the CommunicationStrategy class. It overrides the envoyer method for the "SMS" mode. This method produces a simple display output.
  • Constructor Details

    • SmsCommunication

      SmsCommunication()
  • Method Details

    • envoyer

      public void envoyer(String clientName, String adresse, String message)
      Method for displaying an alert message sent to a client at a given SMS address.
      Specified by:
      envoyer in interface CommunicationStrategy
      Parameters:
      clientName - : The name of the client.
      adresse - : The client's address.
      message - : The message sent.
    • isCorrect

      public boolean isCorrect(String adresse)
      This method provide a simple test for the adress and throw errors to prevent app crashing because of non-reacheable adress
      Specified by:
      isCorrect in interface CommunicationStrategy
      Parameters:
      adresse - : The adress to check
      Returns:
      true if the adress is correct else false