@OpenApiAll
public interface Serviceable
Modifier and Type | Method and Description |
---|---|
<T> T |
getService(java.lang.Class<T> c)
Gets service of given type
|
default <T> T |
getServiceOrFail(java.lang.Class<T> c)
Gets service of the given type or throws
IllegalStateException if there is no such service |
<T> void |
registerService(java.lang.Class<T> type,
T service)
Adds service.
|
@CheckForNull <T> T getService(java.lang.Class<T> c)
c
- the service typenull
if the service is not available for this componentdefault <T> T getServiceOrFail(java.lang.Class<T> c)
IllegalStateException
if there is no such servicec
- the service type<T> void registerService(java.lang.Class<T> type, T service)
type
- service typeservice
- service