Class RegistryBuilderSupport

java.lang.Object
io.helidon.service.registry.RegistryBuilderSupport

public class RegistryBuilderSupport extends Object
Methods used from generated code in builders when the service registry (without Config) is used.
  • Method Details

    • serviceList

      public static <T> List<T> serviceList(Optional<ServiceRegistry> registry, TypeName contract, boolean useRegistry)
      Discover services from the registry.
      Type Parameters:
      T - type of the contract
      Parameters:
      registry - service registry to use, if provided explicitly
      contract - contract that is requested
      useRegistry - whether to use the service registry at all
      Returns:
      a list of contract implementation from the registry
    • serviceList

      public static <T> List<T> serviceList(Optional<ServiceRegistry> registry, TypeName contract, boolean useRegistry, Optional<String> namedQualifier)
      Discover services from the registry.
      Type Parameters:
      T - type of the contract
      Parameters:
      registry - service registry to use, if provided explicitly
      contract - contract that is requested
      useRegistry - whether to use the service registry at all
      namedQualifier - an optional qualifier name to filter the services
      Returns:
      a list of contract implementation from the registry
    • serviceSet

      public static <T> Set<T> serviceSet(Optional<ServiceRegistry> registry, TypeName contract, boolean useRegistry)
      Discover services from the registry.
      Type Parameters:
      T - type of the contract
      Parameters:
      registry - service registry to use, if provided explicitly
      contract - contract that is requested
      useRegistry - whether to use the service registry at all
      Returns:
      a set of contract implementation
    • serviceSet

      public static <T> Set<T> serviceSet(Optional<ServiceRegistry> registry, TypeName contract, boolean useRegistry, Optional<String> namedQualifier)
      Discover services from the registry.
      Type Parameters:
      T - type of the contract
      Parameters:
      registry - service registry to use, if provided explicitly
      contract - contract that is requested
      useRegistry - whether to use the service registry at all
      namedQualifier - an optional qualifier name to filter the services
      Returns:
      a set of contract implementation
    • service

      public static <T> Optional<T> service(Optional<ServiceRegistry> registry, TypeName contract, Optional<T> existingValue, boolean useRegistry)
      Get the first service from the registry if not configured in the builder.
      Type Parameters:
      T - type of the contract
      Parameters:
      registry - service registry to use, if provided explicitly
      contract - contract that is requested
      existingValue - current values configured on the builder
      useRegistry - whether to use the service registry at all
      Returns:
      a list of contract implementation, combined from what user provided in builder and what was discovered in registry
    • service

      public static <T> Optional<T> service(Optional<ServiceRegistry> registry, TypeName contract, Optional<T> existingValue, boolean useRegistry, Optional<String> namedQualifier)
      Retrieves the first matching service based on the provided contract, qualifiers, and the current configuration. Allows for combining explicitly configured values with discovered values from a registry.
      Type Parameters:
      T - the type of the service contract
      Parameters:
      registry - an optional service registry to use, if explicitly provided
      contract - the contract that is requested
      existingValue - an optional existing value, to be used if already present
      useRegistry - a flag indicating whether to use the service registry
      namedQualifier - an optional qualifier name to filter the services
      Returns:
      an optional containing the matching service, if found