Class ServiceInfo.BuilderBase<BUILDER extends ServiceInfo.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ServiceInfo>

java.lang.Object
io.helidon.inject.api.ServiceInfoBasics.BuilderBase<BUILDER,PROTOTYPE>
io.helidon.inject.api.ServiceInfo.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Api, Prototype.Builder<BUILDER,PROTOTYPE>, ServiceInfo, ServiceInfoBasics
Direct Known Subclasses:
ServiceInfo.Builder
Enclosing interface:
ServiceInfo

public abstract static class ServiceInfo.BuilderBase<BUILDER extends ServiceInfo.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ServiceInfo> extends ServiceInfoBasics.BuilderBase<BUILDER,PROTOTYPE> implements Prototype.Builder<BUILDER,PROTOTYPE>, ServiceInfo
Fluent API builder base for ServiceInfo.
  • Field Details

    • DEFAULT_INJECT_WEIGHT

      static final double DEFAULT_INJECT_WEIGHT
      Default weight for any internal Injection service component. It is defined to be Weighted.DEFAULT_WEIGHT - 1 in order to allow any other service implementation to naturally have a higher weight (since it will use the DEFAULT_WEIGHT unless explicitly overridden.
      See Also:
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(ServiceInfo prototype)
      Update this builder from an existing prototype instance.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(ServiceInfo.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and interceptors.
      Overrides:
      preBuildPrototype in class ServiceInfoBasics.BuilderBase<BUILDER extends ServiceInfo.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ServiceInfo>
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.
      Overrides:
      validatePrototype in class ServiceInfoBasics.BuilderBase<BUILDER extends ServiceInfo.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ServiceInfo>
    • addExternalContractImplemented

      public BUILDER addExternalContractImplemented(Class<?> type)
      Add external contract implemented.
      Parameters:
      type - type of the external contract
      Returns:
      updated builder instance
    • activatorTypeName

      public BUILDER activatorTypeName(Class<?> type)
      Activator type.
      Parameters:
      type - type of the activator
      Returns:
      updated builder instance
    • addScopeTypeName

      public BUILDER addScopeTypeName(Class<?> type)
      Add a scope type.
      Parameters:
      type - type of the scope
      Returns:
      updated builder instance
    • externalContractsImplemented

      public BUILDER externalContractsImplemented(Set<? extends TypeName> externalContractsImplemented)
      The managed services external contracts / interfaces. These should also be contained within ServiceInfoBasics.BuilderBase.contractsImplemented(). External contracts are from other modules other than the module containing the implementation typically.
      Parameters:
      externalContractsImplemented - the service external contracts implemented
      Returns:
      updated builder instance
      See Also:
    • addExternalContractsImplemented

      public BUILDER addExternalContractsImplemented(Set<? extends TypeName> externalContractsImplemented)
      The managed services external contracts / interfaces. These should also be contained within ServiceInfoBasics.BuilderBase.contractsImplemented(). External contracts are from other modules other than the module containing the implementation typically.
      Parameters:
      externalContractsImplemented - the service external contracts implemented
      Returns:
      updated builder instance
      See Also:
    • addExternalContractImplemented

      public BUILDER addExternalContractImplemented(TypeName externalContractImplemented)
      The managed services external contracts / interfaces. These should also be contained within ServiceInfoBasics.BuilderBase.contractsImplemented(). External contracts are from other modules other than the module containing the implementation typically.
      Parameters:
      externalContractImplemented - the service external contracts implemented
      Returns:
      updated builder instance
      See Also:
    • addExternalContractImplemented

      public BUILDER addExternalContractImplemented(Consumer<TypeName.Builder> consumer)
      The managed services external contracts / interfaces. These should also be contained within ServiceInfoBasics.BuilderBase.contractsImplemented(). External contracts are from other modules other than the module containing the implementation typically.
      Parameters:
      consumer - the service external contracts implemented
      Returns:
      updated builder instance
      See Also:
    • clearActivatorTypeName

      public BUILDER clearActivatorTypeName()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • activatorTypeName

      public BUILDER activatorTypeName(TypeName activatorTypeName)
      The management agent (i.e., the activator) that is responsible for creating and activating - typically build-time created.
      Parameters:
      activatorTypeName - the activator type name
      Returns:
      updated builder instance
      See Also:
    • activatorTypeName

      public BUILDER activatorTypeName(Consumer<TypeName.Builder> consumer)
      The management agent (i.e., the activator) that is responsible for creating and activating - typically build-time created.
      Parameters:
      consumer - the activator type name
      Returns:
      updated builder instance
      See Also:
    • clearModuleName

      public BUILDER clearModuleName()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • moduleName

      public BUILDER moduleName(String moduleName)
      The name of the ascribed module, if known.
      Parameters:
      moduleName - the module name
      Returns:
      updated builder instance
      See Also:
    • externalContractsImplemented

      public Set<TypeName> externalContractsImplemented()
      The managed services external contracts / interfaces. These should also be contained within ServiceInfoBasics.BuilderBase.contractsImplemented(). External contracts are from other modules other than the module containing the implementation typically.
      Returns:
      the external contracts implemented
    • activatorTypeName

      public Optional<TypeName> activatorTypeName()
      The management agent (i.e., the activator) that is responsible for creating and activating - typically build-time created.
      Returns:
      the activator type name
    • moduleName

      public Optional<String> moduleName()
      The name of the ascribed module, if known.
      Returns:
      the module name
    • toString

      public String toString()
      Overrides:
      toString in class ServiceInfoBasics.BuilderBase<BUILDER extends ServiceInfo.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ServiceInfo>
    • matches

      default boolean matches(ServiceInfoCriteria criteria)
      Determines whether this service info 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
    • serviceTypeName

      TypeName serviceTypeName()
      The managed service implementation Class.
      Returns:
      the service type name
    • scopeTypeNames

      Set<TypeName> scopeTypeNames()
      The managed service assigned Scope's.
      Returns:
      the service scope type name
    • qualifiers

      Set<Qualifier> qualifiers()
      The managed service assigned Qualifier's.
      Returns:
      the service qualifiers
    • contractsImplemented

      Set<TypeName> contractsImplemented()
      The managed services advertised types (i.e., typically its interfaces).
      Returns:
      the service contracts implemented
      See Also:
    • declaredRunLevel

      Optional<Integer> declaredRunLevel()
      The optional RunLevel ascribed to the service.
      Returns:
      the service's run level
      See Also:
    • realizedRunLevel

      default int realizedRunLevel()
      The realized run level will use the default run level if no run level was specified directly.
      Returns:
      the realized run level
      See Also:
    • declaredWeight

      Optional<Double> declaredWeight()
      Weight that was declared on the type itself.
      Returns:
      the declared weight
      See Also:
    • realizedWeight

      default double realizedWeight()
      The realized weight will use Weighted.DEFAULT_WEIGHT if no weight was specified directly.
      Returns:
      the realized weight
      See Also: