Interface Serviceable
-
- All Known Subinterfaces:
IAttachedProject
,IPrimaryProject
,IProject
@OpenApiAll public interface Serviceable
A basic interface for components that provide services
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T> T
getService(java.lang.Class<T> c)
Gets service of given typedefault <T> T
getServiceOrFail(java.lang.Class<T> c)
Gets service of the given type or throwsIllegalStateException
if there is no such service<T> void
registerService(java.lang.Class<T> type, T service)
Adds service.
-
-
-
Method Detail
-
getService
@CheckForNull <T> T getService(java.lang.Class<T> c)
Gets service of given type- Parameters:
c
- the service type- Returns:
- the service or
null
if the service is not available for this component
-
getServiceOrFail
default <T> T getServiceOrFail(java.lang.Class<T> c)
Gets service of the given type or throwsIllegalStateException
if there is no such service- Parameters:
c
- the service type- Returns:
- the service
-
registerService
<T> void registerService(java.lang.Class<T> type, @CheckForNull T service)
Adds service.- Parameters:
type
- service typeservice
- service
-
-