Module io.helidon.service.registry
Package io.helidon.service.registry
Class Lookup.BuilderBase.LookupImpl
java.lang.Object
io.helidon.service.registry.Lookup.BuilderBase.LookupImpl
- All Implemented Interfaces:
Prototype.Api
,Lookup
- Enclosing class:
Lookup.BuilderBase<BUILDER extends Lookup.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends Lookup>
Generated implementation of the prototype, can be extended by descendant prototype implementations.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.service.registry.Lookup
Lookup.Builder, Lookup.BuilderBase<BUILDER extends Lookup.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends Lookup> -
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
LookupImpl
(Lookup.BuilderBase<?, ?> builder) Create an instance providing a builder. -
Method Summary
Modifier and TypeMethodDescriptionThe managed services advertised types (i.e., typically its interfaces, can be throughService.ExternalContracts
).Optional
<GenericType<?>> A singleGenericType
can be defined if the lookup should also honorService.QualifiedFactory
services that can handle any type.Optionally, the injection point search applies to.boolean
If configured, the lookup will return service factories of the chosen types.int
hashCode()
boolean
Whether to include abstract type service descriptors.default boolean
Determines whether this lookup matches the criteria for injection.default boolean
matches
(ServiceInfo serviceInfo) Determines whether this service info criteria matches the service descriptor.default boolean
matchesContracts
(Lookup criteria) Determines whether the provided criteria match just the contracts portion of the provided criteria.default boolean
matchesQualifiers
(Set<Qualifier> qualifiers) Determines whether the provided qualifiers are matched by this lookup criteria.The managed service assigned Qualifier's.runLevel()
The optionalService.RunLevel
ascribed to the service.scopes()
The managed service assigned Scope.The managed service implementation type name.toString()
weight()
Weight that was declared on the type itself.
-
Constructor Details
-
LookupImpl
Create an instance providing a builder.- Parameters:
builder
- extending builder base of this prototype
-
-
Method Details
-
serviceType
Description copied from interface:Lookup
The managed service implementation type name.- Specified by:
serviceType
in interfaceLookup
- Returns:
- the service type name
-
scopes
Description copied from interface:Lookup
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. -
qualifiers
Description copied from interface:Lookup
The managed service assigned Qualifier's.- Specified by:
qualifiers
in interfaceLookup
- Returns:
- the service qualifiers
-
contracts
Description copied from interface:Lookup
The managed services advertised types (i.e., typically its interfaces, can be throughService.ExternalContracts
). -
contractType
Description copied from interface:Lookup
A singleGenericType
can be defined if the lookup should also honorService.QualifiedFactory
services that can handle any type. This would be the target type to convert to. If not specified, Object will be used.- Specified by:
contractType
in interfaceLookup
- Returns:
- generic type of the contract, if only one contract is desired
-
runLevel
Description copied from interface:Lookup
The optionalService.RunLevel
ascribed to the service. -
weight
Description copied from interface:Lookup
Weight that was declared on the type itself. -
includeAbstract
public boolean includeAbstract()Description copied from interface:Lookup
Whether to include abstract type service descriptors.- Specified by:
includeAbstract
in interfaceLookup
- Returns:
- whether to include abstract classes and interfaces
-
dependency
Description copied from interface:Lookup
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.
- Specified by:
dependency
in interfaceLookup
- Returns:
- the optional injection point context info
-
factoryTypes
Description copied from interface:Lookup
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 areSupplier
of the contractFactoryType.QUALIFIED
- services that areService.QualifiedFactory
of the contractFactoryType.SERVICES
- services that areService.ServicesFactory
of the contractFactoryType.INJECTION_POINT
- services that areService.InjectionPointFactory
of the contractFactoryType.NONE
- this has no effect and will not modify the lookup
- Specified by:
factoryTypes
in interfaceLookup
- Returns:
- desired factory types
-
toString
-
equals
-
hashCode
public int hashCode() -
matches
Determines whether this lookup matches the criteria for injection. Matches is a looser form of equality check thanequals()
. If a service matches criteria it is generally assumed to be viable for assignability.- Parameters:
criteria
- the criteria to compare against- Returns:
- true if the criteria provided matches this instance
-
matches
Determines whether this service info criteria matches the service descriptor. Matches is a looser form of equality check thanequals()
. If a service matches criteria it is generally assumed to be viable for assignability.- Parameters:
serviceInfo
- to compare with- Returns:
- true if this criteria matches the service descriptor
-
matchesContracts
Determines whether the provided criteria match just the contracts portion of the provided criteria. Note that it is expected any external contracts have been consolidated into the regular contract section.- Parameters:
criteria
- the criteria to compare against- Returns:
- true if the criteria provided matches this instance from only the contracts point of view
-
matchesQualifiers
Determines whether the provided qualifiers are matched by this lookup criteria.- Parameters:
qualifiers
- qualifiers of a service- Returns:
- whether this lookup matches those qualifiers
-