Package 

Class ServiceProvider

  • All Implemented Interfaces:
    com.onesignal.common.services.IServiceProvider

    
    public final class ServiceProvider
     implements IServiceProvider
                        

    A service provider gives access to the implementations of a service.

    • Method Detail

      • getAllServices

         <T extends Any> List<T> getAllServices(Class<T> c)

        Retrieve the list of services that are a T. If no service exists, an empty list will be returned.

        Parameters:
        c - The class type of the services that are to be retrieved.
      • getService

         <T extends Any> T getService(Class<T> c)

        Retrieve the service that is a T. If multiple services exist, the last one registered will be returned. If no service exists, an exception will be thrown.

        Parameters:
        c - The class type of the service that is to be retrieved.
      • getServiceOrNull

         <T extends Any> T getServiceOrNull(Class<T> c)

        Retrieve the service that is a T. If multiple services exist, the last one registered will be returned. If no service exists, null will be returned.

        Parameters:
        c - The class type of the service that is to be retrieved.