Class ServiceInfo.Builder

All Implemented Interfaces:
Prototype.Api, Prototype.Builder<ServiceInfo.Builder,ServiceInfo>, Builder<ServiceInfo.Builder,ServiceInfo>, ServiceInfo, ServiceInfoBasics, Supplier<ServiceInfo>
Enclosing interface:
ServiceInfo

public static class ServiceInfo.Builder extends ServiceInfo.BuilderBase<ServiceInfo.Builder,ServiceInfo> implements Builder<ServiceInfo.Builder,ServiceInfo>
Fluent API builder 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:
  • Method Details

    • buildPrototype

      public ServiceInfo buildPrototype()
      Specified by:
      buildPrototype in interface Prototype.Builder<ServiceInfo.Builder,ServiceInfo>
    • build

      public ServiceInfo build()
      Specified by:
      build in interface Builder<ServiceInfo.Builder,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: