Interface Mediator

All Known Implementing Classes:
ConcreteMediator

public interface Mediator
Interface for the Mediator in the Mediator Pattern. The Mediator facilitates communication between different colleagues.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Registers a colleague with the mediator.
    void
    sendMessage(Colleague sender, String message)
    Sends a message from one colleague to others.
  • Method Details

    • sendMessage

      void sendMessage(Colleague sender, String message)
      Sends a message from one colleague to others.
      Parameters:
      sender - The colleague sending the message.
      message - The message to send.
    • addColleague

      void addColleague(Colleague colleague)
      Registers a colleague with the mediator.
      Parameters:
      colleague - The colleague to register.