Class ServiceProviderCache

    • Method Detail

      • hasService

        public <S extends Service> boolean hasService​(java.lang.Class<S> serviceType)
        Description copied from interface: ServiceProvider
        Checks if a service of the given serviceType is available. This method will return false in case of the specified service can not be provided for any reason.
        Specified by:
        hasService in interface ServiceProvider
        Returns:
        true if the given service type is supported, false otherwise
      • findService

        public <S extends Service> java.util.Optional<S> findService​(java.lang.Class<S> serviceType)
        Description copied from interface: ServiceProvider
        Returns optional Service instance for the requested serviceType. If no Service exists or can be provided an empty optional is returned.
        Specified by:
        findService in interface ServiceProvider
        Type Parameters:
        S - the type of service
        Parameters:
        serviceType - the type of service to return
        Returns:
        a optional instance of the given service type