Class Lookup.BuilderBase<BUILDER extends Lookup.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends Lookup>
- Type Parameters:
BUILDER- type of the builder extending this abstract builderPROTOTYPE- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>
- Direct Known Subclasses:
Lookup.Builder
- Enclosing interface:
Lookup
Lookup.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddContract(ResolvedType contract) The managed services advertised types (i.e., typically its interfaces, can be throughService.ExternalContracts).addContract(TypeName contract) The managed services advertised types (i.e., typically its interfaces).addContract(Class<?> contract) The managed services advertised types (i.e., typically its interfaces).addContracts(Set<? extends ResolvedType> contracts) The managed services advertised types (i.e., typically its interfaces, can be throughService.ExternalContracts).addFactoryType(FactoryType factoryType) If configured, the lookup will return service factories of the chosen types.addFactoryTypes(Set<? extends FactoryType> factoryTypes) If configured, the lookup will return service factories of the chosen types.addQualifier(Qualifier qualifier) The managed service assigned Qualifier's.addQualifier(Consumer<Qualifier.Builder> consumer) The managed service assigned Qualifier's.addQualifiers(Set<? extends Qualifier> qualifiers) The managed service assigned Qualifier's.The managed service assigned Scope.addScope(Consumer<TypeName.Builder> consumer) The managed service assigned Scope.The managed service assigned Scope.Clear all contracts.Clear existing value of contractType.Clear existing value of dependency.Clear all factoryTypes.Clear all qualifiers.Clear existing value of runLevel.Clear all scopes.Clear existing value of serviceType.Clear existing value of weight.The managed services advertised types (i.e., typically its interfaces, can be throughService.ExternalContracts).contracts(Set<? extends ResolvedType> contracts) The managed services advertised types (i.e., typically its interfaces, can be throughService.ExternalContracts).Optional<GenericType<?>> A singleGenericTypecan be defined if the lookup should also honorService.QualifiedFactoryservices that can handle any type.contractType(GenericType<?> contractType) A singleGenericTypecan be defined if the lookup should also honorService.QualifiedFactoryservices that can handle any type.Optionally, the injection point search applies to.dependency(Dependency dependency) Optionally, the injection point search applies to.dependency(Consumer<Dependency.Builder> consumer) Optionally, the injection point search applies to.dependency(Supplier<? extends Dependency> supplier) Optionally, the injection point search applies to.If configured, the lookup will return service factories of the chosen types.factoryTypes(Set<? extends FactoryType> factoryTypes) If configured, the lookup will return service factories of the chosen types.Update this builder from an existing prototype instance.from(Lookup.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.booleanWhether to include abstract type service descriptors.includeAbstract(boolean includeAbstract) Whether to include abstract type service descriptors.Only lookup services with the provided named qualifier, where name is the fully qualified name of the class.Only lookup services with the provided named qualifier.protected voidHandles providers and decorators.The managed service assigned Qualifier's.qualifiers(Set<? extends Qualifier> qualifiers) The managed service assigned Qualifier's.runLevel()The optionalService.RunLevelascribed to the service.runLevel(double runLevel) The optionalService.RunLevelascribed to the service.scopes()The managed service assigned Scope.The managed service assigned Scope.The managed service implementation type name.serviceType(TypeName serviceType) The managed service implementation type name.serviceType(Class<?> contract) The managed service implementation type.serviceType(Consumer<TypeName.Builder> consumer) The managed service implementation type name.serviceType(Supplier<? extends TypeName> supplier) The managed service implementation type name.toString()protected voidValidates required properties.weight()Weight that was declared on the type itself.weight(double weight) Weight that was declared on the type itself.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
addContract
The managed services advertised types (i.e., typically its interfaces).- Parameters:
contract- the service contracts implemented- Returns:
- updated builder instance
- See Also:
-
addContract
The managed services advertised types (i.e., typically its interfaces).- Parameters:
contract- contract the service implements- Returns:
- updated builder instance
- See Also:
-
serviceType
The managed service implementation type.- Parameters:
contract- the service type- Returns:
- updated builder instance
-
named
Only lookup services with the provided named qualifier.- Parameters:
name- the name qualifier (useService.Named.WILDCARD_NAMEto find all- Returns:
- updated builder instance
-
named
Only lookup services with the provided named qualifier, where name is the fully qualified name of the class.- Parameters:
clazz- fully qualified name of the class is the name qualifier to use- Returns:
- updated builder instance
- See Also:
-
clearServiceType
Clear existing value of serviceType.- Returns:
- updated builder instance
- See Also:
-
serviceType
The managed service implementation type name.- Parameters:
serviceType- the service type name- Returns:
- updated builder instance
- See Also:
-
serviceType
The managed service implementation type name.- Parameters:
consumer- consumer of builder of the service type name- Returns:
- updated builder instance
- See Also:
-
serviceType
The managed service implementation type name.- Parameters:
supplier- supplier of the service type name- Returns:
- updated builder instance
- See Also:
-
clearScopes
Clear all scopes.- Returns:
- updated builder instance
- See Also:
-
scopes
The managed service assigned Scope. If empty, any scope is matched. If more than one value, any service in one of these scopes is matched.- Parameters:
scopes- the service scope type name- Returns:
- updated builder instance
- See Also:
-
addScopes
The managed service assigned Scope. If empty, any scope is matched. If more than one value, any service in one of these scopes is matched.- Parameters:
scopes- the service scope type name- Returns:
- updated builder instance
- See Also:
-
addScope
The managed service assigned Scope. If empty, any scope is matched. If more than one value, any service in one of these scopes is matched.- Parameters:
scope- add single the service scope type name- Returns:
- updated builder instance
- See Also:
-
addScope
The managed service assigned Scope. If empty, any scope is matched. If more than one value, any service in one of these scopes is matched.- Parameters:
consumer- consumer of builder for the service scope type name- Returns:
- updated builder instance
- See Also:
-
clearQualifiers
Clear all qualifiers.- Returns:
- updated builder instance
- See Also:
-
qualifiers
The managed service assigned Qualifier's.- Parameters:
qualifiers- the service qualifiers- Returns:
- updated builder instance
- See Also:
-
addQualifiers
The managed service assigned Qualifier's.- Parameters:
qualifiers- the service qualifiers- Returns:
- updated builder instance
- See Also:
-
addQualifier
The managed service assigned Qualifier's.- Parameters:
qualifier- add single the service qualifiers- Returns:
- updated builder instance
- See Also:
-
addQualifier
The managed service assigned Qualifier's.- Parameters:
consumer- consumer of builder for the service qualifiers- Returns:
- updated builder instance
- See Also:
-
clearContracts
Clear all contracts.- Returns:
- updated builder instance
- See Also:
-
contracts
The managed services advertised types (i.e., typically its interfaces, can be throughService.ExternalContracts).- Parameters:
contracts- the service contracts implemented- Returns:
- updated builder instance
- See Also:
-
addContracts
The managed services advertised types (i.e., typically its interfaces, can be throughService.ExternalContracts).- Parameters:
contracts- the service contracts implemented- Returns:
- updated builder instance
- See Also:
-
addContract
The managed services advertised types (i.e., typically its interfaces, can be throughService.ExternalContracts).- Parameters:
contract- add single the service contracts implemented- Returns:
- updated builder instance
- See Also:
-
clearContractType
Clear existing value of contractType.- Returns:
- updated builder instance
- See Also:
-
contractType
A singleGenericTypecan be defined if the lookup should also honorService.QualifiedFactoryservices that can handle any type. This would be the target type to convert to. If not specified, Object will be used.- Parameters:
contractType- generic type of the contract, if only one contract is desired- Returns:
- updated builder instance
- See Also:
-
clearRunLevel
Clear existing value of runLevel.- Returns:
- updated builder instance
- See Also:
-
runLevel
The optionalService.RunLevelascribed to the service.- Parameters:
runLevel- the service's run level- Returns:
- updated builder instance
- See Also:
-
clearWeight
Clear existing value of weight.- Returns:
- updated builder instance
- See Also:
-
weight
Weight that was declared on the type itself.- Parameters:
weight- the declared weight- Returns:
- updated builder instance
- See Also:
-
includeAbstract
Whether to include abstract type service descriptors.- Parameters:
includeAbstract- whether to include abstract classes and interfaces- Returns:
- updated builder instance
- See Also:
-
clearDependency
Clear existing value of dependency.- Returns:
- updated builder instance
- See Also:
-
dependency
Optionally, the injection point search applies to. There are some service factories (such asService.InjectionPointFactory) that provide instances for a specific injection point. Such factories may require an injection point to be present, and may fail otherwise.Injection points of each service are generated as public constants on their respective service descriptors.
- Parameters:
dependency- the optional injection point context info- Returns:
- updated builder instance
- See Also:
-
dependency
Optionally, the injection point search applies to. There are some service factories (such asService.InjectionPointFactory) that provide instances for a specific injection point. Such factories may require an injection point to be present, and may fail otherwise.Injection points of each service are generated as public constants on their respective service descriptors.
- Parameters:
consumer- consumer of builder of the optional injection point context info- Returns:
- updated builder instance
- See Also:
-
dependency
Optionally, the injection point search applies to. There are some service factories (such asService.InjectionPointFactory) that provide instances for a specific injection point. Such factories may require an injection point to be present, and may fail otherwise.Injection points of each service are generated as public constants on their respective service descriptors.
- Parameters:
supplier- supplier of the optional injection point context info- Returns:
- updated builder instance
- See Also:
-
clearFactoryTypes
Clear all factoryTypes.- Returns:
- updated builder instance
- See Also:
-
factoryTypes
If configured, the lookup will return service factories of the chosen types. If no factory types are defined, service instances are returned.Otherwise only service factories of the chosen types are returned, as follows:
FactoryType.SERVICE- only services that directly implement the contractFactoryType.SUPPLIER- only that areSupplierof the contractFactoryType.QUALIFIED- services that areService.QualifiedFactoryof the contractFactoryType.SERVICES- services that areService.ServicesFactoryof the contractFactoryType.INJECTION_POINT- services that areService.InjectionPointFactoryof the contractFactoryType.NONE- this has no effect and will not modify the lookup
- Parameters:
factoryTypes- desired factory types- Returns:
- updated builder instance
- See Also:
-
addFactoryTypes
If configured, the lookup will return service factories of the chosen types. If no factory types are defined, service instances are returned.Otherwise only service factories of the chosen types are returned, as follows:
FactoryType.SERVICE- only services that directly implement the contractFactoryType.SUPPLIER- only that areSupplierof the contractFactoryType.QUALIFIED- services that areService.QualifiedFactoryof the contractFactoryType.SERVICES- services that areService.ServicesFactoryof the contractFactoryType.INJECTION_POINT- services that areService.InjectionPointFactoryof the contractFactoryType.NONE- this has no effect and will not modify the lookup
- Parameters:
factoryTypes- desired factory types- Returns:
- updated builder instance
- See Also:
-
addFactoryType
If configured, the lookup will return service factories of the chosen types. If no factory types are defined, service instances are returned.Otherwise only service factories of the chosen types are returned, as follows:
FactoryType.SERVICE- only services that directly implement the contractFactoryType.SUPPLIER- only that areSupplierof the contractFactoryType.QUALIFIED- services that areService.QualifiedFactoryof the contractFactoryType.SERVICES- services that areService.ServicesFactoryof the contractFactoryType.INJECTION_POINT- services that areService.InjectionPointFactoryof the contractFactoryType.NONE- this has no effect and will not modify the lookup
- Parameters:
factoryType- add single desired factory types- Returns:
- updated builder instance
- See Also:
-
serviceType
The managed service implementation type name.- Returns:
- the service type name
-
scopes
The managed service assigned Scope. If empty, any scope is matched. If more than one value, any service in one of these scopes is matched.- Returns:
- the service scope type name
-
qualifiers
The managed service assigned Qualifier's.- Returns:
- the service qualifiers
-
contracts
The managed services advertised types (i.e., typically its interfaces, can be throughService.ExternalContracts).- Returns:
- the service contracts implemented
-
contractType
A singleGenericTypecan be defined if the lookup should also honorService.QualifiedFactoryservices that can handle any type. This would be the target type to convert to. If not specified, Object will be used.- Returns:
- generic type of the contract, if only one contract is desired
-
runLevel
The optionalService.RunLevelascribed to the service.- Returns:
- the service's run level
-
weight
Weight that was declared on the type itself.- Returns:
- the declared weight
-
includeAbstract
public boolean includeAbstract()Whether to include abstract type service descriptors.- Returns:
- whether to include abstract classes and interfaces
-
dependency
Optionally, the injection point search applies to. There are some service factories (such asService.InjectionPointFactory) that provide instances for a specific injection point. Such factories may require an injection point to be present, and may fail otherwise.Injection points of each service are generated as public constants on their respective service descriptors.
- Returns:
- the optional injection point context info
-
factoryTypes
If configured, the lookup will return service factories of the chosen types. If no factory types are defined, service instances are returned.Otherwise only service factories of the chosen types are returned, as follows:
FactoryType.SERVICE- only services that directly implement the contractFactoryType.SUPPLIER- only that areSupplierof the contractFactoryType.QUALIFIED- services that areService.QualifiedFactoryof the contractFactoryType.SERVICES- services that areService.ServicesFactoryof the contractFactoryType.INJECTION_POINT- services that areService.InjectionPointFactoryof the contractFactoryType.NONE- this has no effect and will not modify the lookup
- Returns:
- desired factory types
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-