Interface Context


  • public interface Context
    A context defines additional information and resources for the environment in which the components are running.
    • Method Detail

      • getResources

        Stream<Resource> getResources()
        Get all the resources
        Returns:
        stream of resources
      • getResources

        default <R> Stream<R> getResources​(Class<R> resourceClass)
        Get all the resources of that class.
        Type Parameters:
        R - the resource class to return
        Parameters:
        resourceClass - the resource class required
        Returns:
        stream of matching resources
      • getResource

        default <R> Optional<R> getResource​(Class<R> resourceClass)
        Get a single resource which matches.

        If there are multiple matches the underlying implementation may provide any back.

        Type Parameters:
        R - the resource class to return
        Parameters:
        resourceClass - the resource class required
        Returns:
        optional of matching resources