Package notification

Class CommunicationFactory

java.lang.Object
notification.CommunicationFactory

class CommunicationFactory extends Object
This class is responsible for instantiating the correct version of the object in charge of transmission according to a certain mode. It does thanks to a single class method. This class cannot be instantiated.
  • Constructor Details

    • CommunicationFactory

      CommunicationFactory()
  • Method Details

    • CommunicationFactory

      private void CommunicationFactory()
      Private constructor that does nothing to prevent instantiation.
    • create

      public static CommunicationStrategy create(String mode)
      Method that selects the appropriate object to instantiate based on the transmission mode.
      Parameters:
      mode - : The transmission mode.
      Returns:
      the object responsible for transmission according to the mode, otherwise null.