Interface ServiceProvider

All Known Subinterfaces:
ServiceProvider.GameScoped, ServiceProvider.ServerScoped

public interface ServiceProvider
Provides various Sponge services.
  • Method Details

    • provide

      <T> Optional<T> provide(Class<T> serviceClass)
      Provides the service represented by the supplied Class.
      Type Parameters:
      T - The type of service
      Parameters:
      serviceClass - The class
      Returns:
      The service, if one exists
    • registration

      <T> Optional<ServiceRegistration<T>> registration(Class<T> serviceClass)
      Provides the ServiceRegistration for the supplied Class.
      Type Parameters:
      T - The type of service
      Parameters:
      serviceClass - The class
      Returns:
      The registration, if one exists