java.lang.Object
io.helidon.service.registry.RegistryBuilderSupport
Methods used from generated code in builders when the service registry (without Config) is used.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <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.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.static <T> List<T> serviceList(Optional<ServiceRegistry> registry, TypeName contract, boolean useRegistry) Discover services from the registry.static <T> List<T> serviceList(Optional<ServiceRegistry> registry, TypeName contract, boolean useRegistry, Optional<String> namedQualifier) Discover services from the registry.static <T> Set<T> serviceSet(Optional<ServiceRegistry> registry, TypeName contract, boolean useRegistry) Discover services from the registry.static <T> Set<T> serviceSet(Optional<ServiceRegistry> registry, TypeName contract, boolean useRegistry, Optional<String> namedQualifier) Discover services from the registry.
-
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 explicitlycontract- contract that is requesteduseRegistry- 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 explicitlycontract- contract that is requesteduseRegistry- whether to use the service registry at allnamedQualifier- 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 explicitlycontract- contract that is requesteduseRegistry- 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 explicitlycontract- contract that is requesteduseRegistry- whether to use the service registry at allnamedQualifier- 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 explicitlycontract- contract that is requestedexistingValue- current values configured on the builderuseRegistry- 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 providedcontract- the contract that is requestedexistingValue- an optional existing value, to be used if already presentuseRegistry- a flag indicating whether to use the service registrynamedQualifier- an optional qualifier name to filter the services- Returns:
- an optional containing the matching service, if found
-