Interface IServiceMediator


public interface IServiceMediator
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addService(@NonNull String serviceName, @NonNull Object serviceInstance)
    Add a service to the ServiceMediator.
    <T> @NonNull T
    getService(@NonNull Class<T> serviceClass, @NonNull String serviceName)
    Gets a service from the ServiceMediator
  • Method Details

    • addService

      void addService(@NonNull String serviceName, @NonNull Object serviceInstance)
      Add a service to the ServiceMediator.
      Parameters:
      serviceName - The ServiceName
      serviceInstance - The ServiceInstance
    • getService

      <T> @NonNull T getService(@NonNull Class<T> serviceClass, @NonNull String serviceName)
      Gets a service from the ServiceMediator
      Type Parameters:
      T - The type of the Service
      Parameters:
      serviceClass - The ServiceClass you expect
      serviceName - The ServiceName
      Returns:
      The ServiceInstance
      Throws:
      RuntimeException - if no service of the provided type and name is registered