Package org.spongepowered.api.service
Interface ServiceProvider
-
- All Known Subinterfaces:
ServiceProvider.GameScoped,ServiceProvider.ServerScoped
public interface ServiceProviderProvides various Sponge services.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceServiceProvider.GameScopedProvides services that are scoped to aServiceProvider.GameScopedinstance.static interfaceServiceProvider.ServerScopedProvides serivces that are scoped to theServiceProvider.ServerScopedEngineonly.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Optional<T>provide(Class<T> serviceClass)Provides the service represented by the suppliedClass.<T> Optional<ServiceRegistration<T>>registration(Class<T> serviceClass)Provides theServiceRegistrationfor the suppliedClass.
-
-
-
Method Detail
-
provide
<T> Optional<T> provide(Class<T> serviceClass)
Provides the service represented by the suppliedClass.- 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 theServiceRegistrationfor the suppliedClass.- Type Parameters:
T- The type of service- Parameters:
serviceClass- The class- Returns:
- The registration, if one exists
-
-