Package com.io7m.idstore.services.api

# Interface IdServiceDirectoryType

All Superinterfaces:
  `AutoCloseable`, `Closeable`

All Known Implementing Classes:
  `IdServiceDirectory`

public interface IdServiceDirectoryType extends Closeable
The type of service directories.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `<T extends IdServiceType>
  Optional<T>`
  `optionalService(Class<T> clazz)`
  Get an optional reference to the given service.
  `<T extends IdServiceType>
  List<? extends T>`
  `optionalServices(Class<T> clazz)`
  Get references to the given services.
  `<T extends IdServiceType>
  T`
  `requireService(Class<T> clazz)`
  Get a required reference to the given service.
  `List<IdServiceType>`
  `services()`

  ### Methods inherited from interface java.io.Closeable

  `close`

- ## Method Details

  - ### optionalService

    <T extends IdServiceType> Optional<T> optionalService(Class<T> clazz)
    Get an optional reference to the given service.
    Type Parameters:
      `T` - The service type
    Parameters:
      `clazz` - The service interface
    Returns:
      A service reference, if a service exists

  - ### requireService

    <T extends IdServiceType> T requireService(Class<T> clazz) throws IdServiceException
    Get a required reference to the given service.
    Type Parameters:
      `T` - The service type
    Parameters:
      `clazz` - The service interface
    Returns:
      A service reference
    Throws:
      `IdServiceException` - If no service exists

  - ### optionalServices

    <T extends IdServiceType> List<? extends T> optionalServices(Class<T> clazz) throws IdServiceException
    Get references to the given services.
    Type Parameters:
      `T` - The service type
    Parameters:
      `clazz` - The service interface
    Returns:
      A service list, if services exist
    Throws:
      `IdServiceException` - If no required

  - ### services

    List<IdServiceType> services()
    Returns:
      A read-only list of all the services present