Interface Serviceable

    • 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 throws IllegalStateException 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 type
        service - service