Class Dependency.BuilderBase.DependencyImpl

java.lang.Object
io.helidon.service.registry.Dependency.BuilderBase.DependencyImpl
All Implemented Interfaces:
Prototype.Api, Dependency
Enclosing class:
Dependency.BuilderBase<BUILDER extends Dependency.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends Dependency>

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

    • DependencyImpl

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

    • service

      public TypeName service()
      Description copied from interface: Dependency
      Type name of the service that uses this dependency.
      Specified by:
      service in interface Dependency
      Returns:
      the service declaring this dependency
    • name

      public String name()
      Description copied from interface: Dependency
      Name of the constructor parameter.
      Specified by:
      name in interface Dependency
      Returns:
      unique name of the parameter
    • contract

      public TypeName contract()
      Description copied from interface: Dependency
      Each dependency ia a specific contract. Each service provides one or more contracts for dependencies. For example for List<MyService>, the contract is MyService.
      Specified by:
      contract in interface Dependency
      Returns:
      contract of the service we depend on
    • contractType

      public GenericType<?> contractType()
      Description copied from interface: Dependency
      Generic type equivalent to Dependency.contract(). We need both, to prevent reflection at runtime.
      Specified by:
      contractType in interface Dependency
      Returns:
      generic type of the dependency
    • descriptor

      public TypeName descriptor()
      Description copied from interface: Dependency
      Descriptor declaring this dependency. Descriptor is always public.
      Specified by:
      descriptor in interface Dependency
      Returns:
      descriptor
    • descriptorConstant

      public String descriptorConstant()
      Description copied from interface: Dependency
      Field name that declares this dependency in the Dependency.descriptor(). Can be used for code generation. This field is always a public constant.
      Specified by:
      descriptorConstant in interface Dependency
      Returns:
      field that has the dependency on the descriptor type
    • typeName

      public TypeName typeName()
      Description copied from interface: Dependency
      Type of the dependency (exact parameter type with all generics).
      Specified by:
      typeName in interface Dependency
      Returns:
      type of the dependency as TypeName
    • elementKind

      public ElementKind elementKind()
      Description copied from interface: Dependency
      Kind of element we inject into (constructor, field, method).
      Specified by:
      elementKind in interface Dependency
      Returns:
      element kind (for parameters, the containing element)
    • qualifiers

      public Set<Qualifier> qualifiers()
      Description copied from interface: Dependency
      The qualifier type annotations on this element.
      Specified by:
      qualifiers in interface Dependency
      Returns:
      the qualifier type annotations on this element
    • access

      public AccessModifier access()
      Description copied from interface: Dependency
      The access modifier on the injection point/receiver. Defaults to AccessModifier.PACKAGE_PRIVATE.
      Specified by:
      access in interface Dependency
      Returns:
      the access
    • annotations

      public Set<Annotation> annotations()
      Description copied from interface: Dependency
      The annotations on this element, excluding Dependency.qualifiers().
      Specified by:
      annotations in interface Dependency
      Returns:
      the annotations on this element
    • method

      public Optional<String> method()
      Description copied from interface: Dependency
      Top level method that declares this method. This is to provide information about overridden methods, as we should only inject such methods once.
      Specified by:
      method in interface Dependency
      Returns:
      unique identification of a declaring method
    • cardinality

      public DependencyCardinality cardinality()
      Description copied from interface: Dependency
      Cardinality of this dependency. Defaults to DependencyCardinality.REQUIRED.
      Specified by:
      cardinality in interface Dependency
      Returns:
      cardinality of this dependency
    • isServiceInstance

      public boolean isServiceInstance()
      Description copied from interface: Dependency
      Whether this dependency uses ServiceInstance. Defaults to false, which means the service is injected via its contract.
      Specified by:
      isServiceInstance in interface Dependency
      Returns:
      whether the dependency is declared as a ServiceInstance
    • isSupplier

      public boolean isSupplier()
      Description copied from interface: Dependency
      Whether this dependency uses a Supplier instead of a direct instance. This defaults to false.
      Specified by:
      isSupplier in interface Dependency
      Returns:
      whether the dependency injection point uses a supplier
    • 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