Class RegistryBuilderSupport

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

public class RegistryBuilderSupport extends Object
Methods used from generated code in builders when 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
    • 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
    • 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