Interface IServiceMediator
public interface IServiceMediator
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddService(@NonNull String serviceName, @NonNull Object serviceInstance) Add a service to the ServiceMediator.<T> @NonNull TgetService(@NonNull Class<T> serviceClass, @NonNull String serviceName) Gets a service from the ServiceMediator
-
Method Details
-
addService
Add a service to the ServiceMediator.- Parameters:
serviceName- The ServiceNameserviceInstance- The ServiceInstance
-
getService
Gets a service from the ServiceMediator- Type Parameters:
T- The type of the Service- Parameters:
serviceClass- The ServiceClass you expectserviceName- The ServiceName- Returns:
- The ServiceInstance
- Throws:
RuntimeException- if no service of the provided type and name is registered
-