Interface ToolEnvironment

All Known Implementing Classes:
MapToolEnvironment

public interface ToolEnvironment
Typed registry of runtime-level dependencies that ToolFactory instances may request at bind time. The runtime populates it with whatever services and configuration the host application wants to expose to tools (repositories, HTTP clients, API keys, base directories, ...).

A factory should only pull the values it actually needs — there is no shared god-context. Missing values return Optional.empty() or null, and it is the factory's responsibility to decide whether that makes the tool unavailable.

  • Method Summary

    Modifier and Type
    Method
    Description
    <T> Optional<T>
    get(Class<T> type)
    Look up a service by type.
    Look up a named string value (e.g. an API key or base directory).
    default <T> T
    require(Class<T> type)
    Required-type accessor; throws if no service of the given type is registered.
    default String
    Required-string accessor; throws if no value is bound for the key.
  • Method Details

    • get

      <T> Optional<T> get(Class<T> type)
      Look up a service by type. Returns empty if no such service is registered.
    • getString

      Optional<String> getString(String key)
      Look up a named string value (e.g. an API key or base directory).
    • require

      default <T> T require(Class<T> type)
      Required-type accessor; throws if no service of the given type is registered.
    • requireString

      default String requireString(String key)
      Required-string accessor; throws if no value is bound for the key.