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

java.lang.Object
io.helidon.common.types.ModuleTypeInfo.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.Builder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
ModuleTypeInfo.Builder
Enclosing interface:
ModuleTypeInfo

public abstract static class ModuleTypeInfo.BuilderBase<BUILDER extends ModuleTypeInfo.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ModuleTypeInfo> extends Object implements Prototype.Builder<BUILDER,PROTOTYPE>
Fluent API builder base for ModuleTypeInfo.
  • Constructor Details

    • BuilderBase

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

    • from

      public BUILDER from(ModuleTypeInfo prototype)
      Update this builder from an existing prototype instance. This method disables automatic service discovery.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(ModuleTypeInfo.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
    • name

      public BUILDER name(String name)
      Module name.
      Parameters:
      name - name of this module
      Returns:
      updated builder instance
      See Also:
    • clearDescription

      public BUILDER clearDescription()
      Clear existing value of description.
      Returns:
      updated builder instance
      See Also:
    • description

      public BUILDER description(String description)
      Description, such as javadoc, if available.
      Parameters:
      description - description of this element
      Returns:
      updated builder instance
      See Also:
    • isOpen

      public BUILDER isOpen(boolean isOpen)
      Whether this is an open module.
      Parameters:
      isOpen - if open
      Returns:
      updated builder instance
      See Also:
    • clearRequires

      public BUILDER clearRequires()
      Clear all requires.
      Returns:
      updated builder instance
      See Also:
    • requires

      public BUILDER requires(List<? extends ModuleInfoRequires> requires)
      List of requires directives.
      Parameters:
      requires - requires
      Returns:
      updated builder instance
      See Also:
    • addRequires

      public BUILDER addRequires(List<? extends ModuleInfoRequires> requires)
      List of requires directives.
      Parameters:
      requires - requires
      Returns:
      updated builder instance
      See Also:
    • addRequire

      public BUILDER addRequire(ModuleInfoRequires require)
      List of requires directives.
      Parameters:
      require - add single requires
      Returns:
      updated builder instance
      See Also:
    • addRequire

      public BUILDER addRequire(Consumer<ModuleInfoRequires.Builder> consumer)
      List of requires directives.
      Parameters:
      consumer - consumer of builder for requires
      Returns:
      updated builder instance
      See Also:
    • clearExports

      public BUILDER clearExports()
      Clear all exports.
      Returns:
      updated builder instance
      See Also:
    • exports

      public BUILDER exports(List<? extends ModuleInfoExports> exports)
      List of exports directives.
      Parameters:
      exports - exports
      Returns:
      updated builder instance
      See Also:
    • addExports

      public BUILDER addExports(List<? extends ModuleInfoExports> exports)
      List of exports directives.
      Parameters:
      exports - exports
      Returns:
      updated builder instance
      See Also:
    • addExport

      public BUILDER addExport(ModuleInfoExports export)
      List of exports directives.
      Parameters:
      export - add single exports
      Returns:
      updated builder instance
      See Also:
    • addExport

      public BUILDER addExport(Consumer<ModuleInfoExports.Builder> consumer)
      List of exports directives.
      Parameters:
      consumer - consumer of builder for exports
      Returns:
      updated builder instance
      See Also:
    • clearOpens

      public BUILDER clearOpens()
      Clear all opens.
      Returns:
      updated builder instance
      See Also:
    • opens

      public BUILDER opens(List<? extends ModuleInfoOpens> opens)
      List of opens directives.
      Parameters:
      opens - opens
      Returns:
      updated builder instance
      See Also:
    • addOpens

      public BUILDER addOpens(List<? extends ModuleInfoOpens> opens)
      List of opens directives.
      Parameters:
      opens - opens
      Returns:
      updated builder instance
      See Also:
    • addOpen

      public BUILDER addOpen(ModuleInfoOpens open)
      List of opens directives.
      Parameters:
      open - add single opens
      Returns:
      updated builder instance
      See Also:
    • addOpen

      public BUILDER addOpen(Consumer<ModuleInfoOpens.Builder> consumer)
      List of opens directives.
      Parameters:
      consumer - consumer of builder for opens
      Returns:
      updated builder instance
      See Also:
    • clearUses

      public BUILDER clearUses()
      Clear all uses.
      Returns:
      updated builder instance
      See Also:
    • uses

      public BUILDER uses(List<? extends ModuleInfoUses> uses)
      List of uses directives.
      Parameters:
      uses - uses
      Returns:
      updated builder instance
      See Also:
    • addUses

      public BUILDER addUses(List<? extends ModuleInfoUses> uses)
      List of uses directives.
      Parameters:
      uses - uses
      Returns:
      updated builder instance
      See Also:
    • addUse

      public BUILDER addUse(ModuleInfoUses use)
      List of uses directives.
      Parameters:
      use - add single uses
      Returns:
      updated builder instance
      See Also:
    • addUse

      public BUILDER addUse(Consumer<ModuleInfoUses.Builder> consumer)
      List of uses directives.
      Parameters:
      consumer - consumer of builder for uses
      Returns:
      updated builder instance
      See Also:
    • clearProvides

      public BUILDER clearProvides()
      Clear all provides.
      Returns:
      updated builder instance
      See Also:
    • provides

      public BUILDER provides(List<? extends ModuleInfoProvides> provides)
      List of provides directives.
      Parameters:
      provides - provides
      Returns:
      updated builder instance
      See Also:
    • addProvides

      public BUILDER addProvides(List<? extends ModuleInfoProvides> provides)
      List of provides directives.
      Parameters:
      provides - provides
      Returns:
      updated builder instance
      See Also:
    • addProvide

      public BUILDER addProvide(ModuleInfoProvides provide)
      List of provides directives.
      Parameters:
      provide - add single provides
      Returns:
      updated builder instance
      See Also:
    • addProvide

      public BUILDER addProvide(Consumer<ModuleInfoProvides.Builder> consumer)
      List of provides directives.
      Parameters:
      consumer - consumer of builder for provides
      Returns:
      updated builder instance
      See Also:
    • clearOriginatingElement

      public BUILDER clearOriginatingElement()
      Clear existing value of originatingElement.
      Returns:
      updated builder instance
      See Also:
    • originatingElement

      public BUILDER originatingElement(Object originatingElement)
      The element used to create this instance. The type of the object depends on the environment we are in - it may be an TypeElement in annotation processing, or a ClassInfo when using classpath scanning.
      Parameters:
      originatingElement - originating element
      Returns:
      updated builder instance
      See Also:
    • clearAnnotations

      public BUILDER clearAnnotations()
      Clear all annotations.
      Returns:
      updated builder instance
      See Also:
    • annotations

      public BUILDER annotations(List<? extends Annotation> annotations)
      List of declared and known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build (such as the of the annotation).
      Parameters:
      annotations - the list of annotations declared on this element
      Returns:
      updated builder instance
      See Also:
    • addAnnotations

      public BUILDER addAnnotations(List<? extends Annotation> annotations)
      List of declared and known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build (such as the of the annotation).
      Parameters:
      annotations - the list of annotations declared on this element
      Returns:
      updated builder instance
      See Also:
    • addAnnotation

      public BUILDER addAnnotation(Annotation annotation)
      List of declared and known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build (such as the of the annotation).
      Parameters:
      annotation - add single the list of annotations declared on this element
      Returns:
      updated builder instance
      See Also:
    • addAnnotation

      public BUILDER addAnnotation(Consumer<Annotation.Builder> consumer)
      List of declared and known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build (such as the of the annotation).
      Parameters:
      consumer - consumer of builder for the list of annotations declared on this element
      Returns:
      updated builder instance
      See Also:
    • clearInheritedAnnotations

      public BUILDER clearInheritedAnnotations()
      Clear all inheritedAnnotations.
      Returns:
      updated builder instance
      See Also:
    • inheritedAnnotations

      public BUILDER inheritedAnnotations(List<? extends Annotation> inheritedAnnotations)
      List of all inherited annotations for this element. Inherited annotations are annotations declared on annotations of this element that are also marked as Inherited.

      The returned list does not contain annotations(). If a meta-annotation is present on multiple annotations, it will be returned once for each such declaration.

      This method does not return annotations on super types or interfaces!

      Parameters:
      inheritedAnnotations - list of all meta annotations of this element
      Returns:
      updated builder instance
      See Also:
    • addInheritedAnnotations

      public BUILDER addInheritedAnnotations(List<? extends Annotation> inheritedAnnotations)
      List of all inherited annotations for this element. Inherited annotations are annotations declared on annotations of this element that are also marked as Inherited.

      The returned list does not contain annotations(). If a meta-annotation is present on multiple annotations, it will be returned once for each such declaration.

      This method does not return annotations on super types or interfaces!

      Parameters:
      inheritedAnnotations - list of all meta annotations of this element
      Returns:
      updated builder instance
      See Also:
    • addInheritedAnnotation

      public BUILDER addInheritedAnnotation(Annotation inheritedAnnotation)
      List of all inherited annotations for this element. Inherited annotations are annotations declared on annotations of this element that are also marked as Inherited.

      The returned list does not contain annotations(). If a meta-annotation is present on multiple annotations, it will be returned once for each such declaration.

      This method does not return annotations on super types or interfaces!

      Parameters:
      inheritedAnnotation - add single list of all meta annotations of this element
      Returns:
      updated builder instance
      See Also:
    • addInheritedAnnotation

      public BUILDER addInheritedAnnotation(Consumer<Annotation.Builder> consumer)
      List of all inherited annotations for this element. Inherited annotations are annotations declared on annotations of this element that are also marked as Inherited.

      The returned list does not contain annotations(). If a meta-annotation is present on multiple annotations, it will be returned once for each such declaration.

      This method does not return annotations on super types or interfaces!

      Parameters:
      consumer - consumer of builder for list of all meta annotations of this element
      Returns:
      updated builder instance
      See Also:
    • name

      public Optional<String> name()
      Module name.
      Returns:
      name of this module
    • description

      public Optional<String> description()
      Description, such as javadoc, if available.
      Returns:
      description of this element
    • isOpen

      public boolean isOpen()
      Whether this is an open module.
      Returns:
      if open
    • requires

      public List<ModuleInfoRequires> requires()
      List of requires directives.
      Returns:
      requires
    • exports

      public List<ModuleInfoExports> exports()
      List of exports directives.
      Returns:
      exports
    • opens

      public List<ModuleInfoOpens> opens()
      List of opens directives.
      Returns:
      opens
    • uses

      public List<ModuleInfoUses> uses()
      List of uses directives.
      Returns:
      uses
    • provides

      public List<ModuleInfoProvides> provides()
      List of provides directives.
      Returns:
      provides
    • originatingElement

      public Optional<Object> originatingElement()
      The element used to create this instance. The type of the object depends on the environment we are in - it may be an TypeElement in annotation processing, or a ClassInfo when using classpath scanning.
      Returns:
      originating element
    • annotations

      public List<Annotation> annotations()
      List of declared and known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build (such as the of the annotation).
      Returns:
      the list of annotations declared on this element
    • inheritedAnnotations

      public List<Annotation> inheritedAnnotations()
      List of all inherited annotations for this element. Inherited annotations are annotations declared on annotations of this element that are also marked as Inherited.

      The returned list does not contain annotations(). If a meta-annotation is present on multiple annotations, it will be returned once for each such declaration.

      This method does not return annotations on super types or interfaces!

      Returns:
      list of all meta annotations of this element
    • toString

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

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.