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>

protected static class Lookup.BuilderBase.LookupImpl extends Object implements Lookup
Generated implementation of the prototype, can be extended by descendant prototype implementations.
  • Constructor Details

    • LookupImpl

      protected LookupImpl(Lookup.BuilderBase<?,?> builder)
      Create an instance providing a builder.
      Parameters:
      builder - extending builder base of this prototype
  • Method Details

    • serviceType

      public Optional<TypeName> serviceType()
      Description copied from interface: Lookup
      The managed service implementation type name.
      Specified by:
      serviceType in interface Lookup
      Returns:
      the service type name
    • scopes

      public Set<TypeName> 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.
      Specified by:
      scopes in interface Lookup
      Returns:
      the service scope type name
    • qualifiers

      public Set<Qualifier> qualifiers()
      Description copied from interface: Lookup
      The managed service assigned Qualifier's.
      Specified by:
      qualifiers in interface Lookup
      Returns:
      the service qualifiers
    • contracts

      public Set<ResolvedType> contracts()
      Description copied from interface: Lookup
      The managed services advertised types (i.e., typically its interfaces, can be through Service.ExternalContracts).
      Specified by:
      contracts in interface Lookup
      Returns:
      the service contracts implemented
    • contractType

      public Optional<GenericType<?>> contractType()
      Description copied from interface: Lookup
      A single GenericType can be defined if the lookup should also honor Service.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 interface Lookup
      Returns:
      generic type of the contract, if only one contract is desired
    • runLevel

      public Optional<Double> runLevel()
      Description copied from interface: Lookup
      The optional Service.RunLevel ascribed to the service.
      Specified by:
      runLevel in interface Lookup
      Returns:
      the service's run level
    • weight

      public Optional<Double> weight()
      Description copied from interface: Lookup
      Weight that was declared on the type itself.
      Specified by:
      weight in interface Lookup
      Returns:
      the declared weight
    • includeAbstract

      public boolean includeAbstract()
      Description copied from interface: Lookup
      Whether to include abstract type service descriptors.
      Specified by:
      includeAbstract in interface Lookup
      Returns:
      whether to include abstract classes and interfaces
    • dependency

      public Optional<Dependency> dependency()
      Description copied from interface: Lookup
      Optionally, the injection point search applies to. There are some service factories (such as Service.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 interface Lookup
      Returns:
      the optional injection point context info
    • factoryTypes

      public Set<FactoryType> 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:

      Specified by:
      factoryTypes in interface Lookup
      Returns:
      desired factory types
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • matches

      default boolean matches(Lookup criteria)
      Determines whether this lookup matches the criteria for injection. Matches is a looser form of equality check than equals(). 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

      default boolean matches(ServiceInfo serviceInfo)
      Determines whether this service info criteria matches the service descriptor. Matches is a looser form of equality check than equals(). 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

      default boolean matchesContracts(Lookup criteria)
      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

      default boolean matchesQualifiers(Set<Qualifier> qualifiers)
      Determines whether the provided qualifiers are matched by this lookup criteria.
      Parameters:
      qualifiers - qualifiers of a service
      Returns:
      whether this lookup matches those qualifiers