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

java.lang.Object
io.helidon.common.types.TypeInfo.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:
TypeInfo.Builder
Enclosing interface:
TypeInfo

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

    • BuilderBase

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

    • from

      public BUILDER from(TypeInfo 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(TypeInfo.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
    • typeName

      public BUILDER typeName(TypeName typeName)
      The type name.
      Parameters:
      typeName - the type name
      Returns:
      updated builder instance
      See Also:
    • typeName

      public BUILDER typeName(Consumer<TypeName.Builder> consumer)
      The type name.
      Parameters:
      consumer - consumer of builder for the type name
      Returns:
      updated builder instance
      See Also:
    • typeName

      public BUILDER typeName(Supplier<? extends TypeName> supplier)
      The type name.
      Parameters:
      supplier - supplier of the type name
      Returns:
      updated builder instance
      See Also:
    • clearDescription

      public BUILDER clearDescription()
      Clear existing value of this property.
      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:
    • typeKind

      @Deprecated(since="4.1.0", forRemoval=true) public BUILDER typeKind(String typeKind)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use kind() instead
      The type element kind.

      Such as

      Parameters:
      typeKind - the type element kind.
      Returns:
      updated builder instance
      See Also:
    • kind

      public BUILDER kind(ElementKind kind)
      Parameters:
      kind - element kind of this type
      Returns:
      updated builder instance
      See Also:
    • elementInfo

      public BUILDER elementInfo(List<? extends TypedElementInfo> elementInfo)
      The elements that make up the type that are relevant for processing.
      Parameters:
      elementInfo - the elements that make up the type that are relevant for processing
      Returns:
      updated builder instance
      See Also:
    • addElementInfo

      public BUILDER addElementInfo(List<? extends TypedElementInfo> elementInfo)
      The elements that make up the type that are relevant for processing.
      Parameters:
      elementInfo - the elements that make up the type that are relevant for processing
      Returns:
      updated builder instance
      See Also:
    • addElementInfo

      public BUILDER addElementInfo(TypedElementInfo elementInfo)
      The elements that make up the type that are relevant for processing.
      Parameters:
      elementInfo - the elements that make up the type that are relevant for processing
      Returns:
      updated builder instance
      See Also:
    • addElementInfo

      public BUILDER addElementInfo(Consumer<TypedElementInfo.Builder> consumer)
      The elements that make up the type that are relevant for processing.
      Parameters:
      consumer - the elements that make up the type that are relevant for processing
      Returns:
      updated builder instance
      See Also:
    • otherElementInfo

      public BUILDER otherElementInfo(List<? extends TypedElementInfo> otherElementInfo)
      The elements that make up this type that are considered "other", or being skipped because they are irrelevant to processing.
      Parameters:
      otherElementInfo - the elements that still make up the type, but are otherwise deemed irrelevant for processing
      Returns:
      updated builder instance
      See Also:
    • addOtherElementInfo

      public BUILDER addOtherElementInfo(List<? extends TypedElementInfo> otherElementInfo)
      The elements that make up this type that are considered "other", or being skipped because they are irrelevant to processing.
      Parameters:
      otherElementInfo - the elements that still make up the type, but are otherwise deemed irrelevant for processing
      Returns:
      updated builder instance
      See Also:
    • addOtherElementInfo

      public BUILDER addOtherElementInfo(TypedElementInfo otherElementInfo)
      The elements that make up this type that are considered "other", or being skipped because they are irrelevant to processing.
      Parameters:
      otherElementInfo - the elements that still make up the type, but are otherwise deemed irrelevant for processing
      Returns:
      updated builder instance
      See Also:
    • addOtherElementInfo

      public BUILDER addOtherElementInfo(Consumer<TypedElementInfo.Builder> consumer)
      The elements that make up this type that are considered "other", or being skipped because they are irrelevant to processing.
      Parameters:
      consumer - the elements that still make up the type, but are otherwise deemed irrelevant for processing
      Returns:
      updated builder instance
      See Also:
    • referencedTypeNamesToAnnotations

      public BUILDER referencedTypeNamesToAnnotations(Map<? extends TypeName,List<Annotation>> referencedTypeNamesToAnnotations)
      This method replaces all values with the new ones.
      Parameters:
      referencedTypeNamesToAnnotations - all referenced types
      Returns:
      updated builder instance
      See Also:
    • addReferencedTypeNamesToAnnotations

      public BUILDER addReferencedTypeNamesToAnnotations(Map<? extends TypeName,List<Annotation>> referencedTypeNamesToAnnotations)
      This method keeps existing values, then puts all new values into the map.
      Parameters:
      referencedTypeNamesToAnnotations - all referenced types
      Returns:
      updated builder instance
      See Also:
    • addReferencedTypeNamesToAnnotation

      public BUILDER addReferencedTypeNamesToAnnotation(TypeName key, Annotation referencedTypeNamesToAnnotation)
      This method adds a new value to the map value, or creates a new value.
      Parameters:
      key - key to add to
      referencedTypeNamesToAnnotation - additional value for the key
      Returns:
      updated builder instance
      See Also:
    • addReferencedTypeNamesToAnnotations

      public BUILDER addReferencedTypeNamesToAnnotations(TypeName key, List<Annotation> referencedTypeNamesToAnnotations)
      This method adds a new value to the map value, or creates a new value.
      Parameters:
      key - key to add to
      referencedTypeNamesToAnnotations - additional values for the key
      Returns:
      updated builder instance
      See Also:
    • putReferencedTypeNamesToAnnotation

      public BUILDER putReferencedTypeNamesToAnnotation(TypeName key, List<Annotation> referencedTypeNamesToAnnotation)
      This method adds a new value to the map, or replaces it if the key already exists.
      Parameters:
      key - key to add or replace
      referencedTypeNamesToAnnotation - new value for the key
      Returns:
      updated builder instance
      See Also:
    • referencedModuleNames

      public BUILDER referencedModuleNames(Map<? extends TypeName,? extends String> referencedModuleNames)
      This method replaces all values with the new ones.
      Parameters:
      referencedModuleNames - type names to its associated defining module name
      Returns:
      updated builder instance
      See Also:
    • addReferencedModuleNames

      public BUILDER addReferencedModuleNames(Map<? extends TypeName,? extends String> referencedModuleNames)
      This method keeps existing values, then puts all new values into the map.
      Parameters:
      referencedModuleNames - type names to its associated defining module name
      Returns:
      updated builder instance
      See Also:
    • putReferencedModuleName

      public BUILDER putReferencedModuleName(TypeName key, String referencedModuleName)
      This method adds a new value to the map, or replaces it if the key already exists.
      Parameters:
      key - key to add or replace
      referencedModuleName - new value for the key
      Returns:
      updated builder instance
      See Also:
    • clearSuperTypeInfo

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

      public BUILDER superTypeInfo(TypeInfo superTypeInfo)
      The parent/super class for this type info.
      Parameters:
      superTypeInfo - the super type
      Returns:
      updated builder instance
      See Also:
    • superTypeInfo

      public BUILDER superTypeInfo(Consumer<TypeInfo.Builder> consumer)
      The parent/super class for this type info.
      Parameters:
      consumer - the super type
      Returns:
      updated builder instance
      See Also:
    • interfaceTypeInfo

      public BUILDER interfaceTypeInfo(List<? extends TypeInfo> interfaceTypeInfo)
      The interface classes for this type info.
      Parameters:
      interfaceTypeInfo - the interface type info
      Returns:
      updated builder instance
      See Also:
    • addInterfaceTypeInfo

      public BUILDER addInterfaceTypeInfo(List<? extends TypeInfo> interfaceTypeInfo)
      The interface classes for this type info.
      Parameters:
      interfaceTypeInfo - the interface type info
      Returns:
      updated builder instance
      See Also:
    • addInterfaceTypeInfo

      public BUILDER addInterfaceTypeInfo(TypeInfo interfaceTypeInfo)
      The interface classes for this type info.
      Parameters:
      interfaceTypeInfo - the interface type info
      Returns:
      updated builder instance
      See Also:
    • addInterfaceTypeInfo

      public BUILDER addInterfaceTypeInfo(Consumer<TypeInfo.Builder> consumer)
      The interface classes for this type info.
      Parameters:
      consumer - the interface type info
      Returns:
      updated builder instance
      See Also:
    • modifiers

      public BUILDER modifiers(Set<? extends String> modifiers)
      Element modifiers.
      Parameters:
      modifiers - element modifiers
      Returns:
      updated builder instance
      See Also:
    • addModifiers

      public BUILDER addModifiers(Set<? extends String> modifiers)
      Element modifiers.
      Parameters:
      modifiers - element modifiers
      Returns:
      updated builder instance
      See Also:
    • addModifier

      @Deprecated(since="4.1.0", forRemoval=true) public BUILDER addModifier(String modifier)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use elementModifiers() instead
      Element modifiers.
      Parameters:
      modifier - element modifiers
      Returns:
      updated builder instance
      See Also:
    • elementModifiers

      public BUILDER elementModifiers(Set<? extends Modifier> elementModifiers)
      Type modifiers.
      Parameters:
      elementModifiers - set of modifiers that are present on the type (and that we understand)
      Returns:
      updated builder instance
      See Also:
    • addElementModifiers

      public BUILDER addElementModifiers(Set<? extends Modifier> elementModifiers)
      Type modifiers.
      Parameters:
      elementModifiers - set of modifiers that are present on the type (and that we understand)
      Returns:
      updated builder instance
      See Also:
    • addElementModifier

      public BUILDER addElementModifier(Modifier elementModifier)
      Type modifiers.
      Parameters:
      elementModifier - set of modifiers that are present on the type (and that we understand)
      Returns:
      updated builder instance
      See Also:
    • accessModifier

      public BUILDER accessModifier(AccessModifier accessModifier)
      Access modifier.
      Parameters:
      accessModifier - access modifier
      Returns:
      updated builder instance
      See Also:
    • clearModule

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

      public BUILDER module(String module)
      Module of this type, if available.
      Parameters:
      module - module name
      Returns:
      updated builder instance
      See Also:
    • clearOriginatingElement

      public BUILDER clearOriginatingElement()
      Clear existing value of this property.
      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:
    • 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 - 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 - the list of annotations declared on this element
      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.

      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.

      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.

      Parameters:
      inheritedAnnotation - 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.

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

      public Optional<TypeName> typeName()
      The type name.
      Returns:
      the type name
    • description

      public Optional<String> description()
      Description, such as javadoc, if available.
      Returns:
      the description
    • typeKind

      @Deprecated(since="4.1.0", forRemoval=true) public Optional<String> typeKind()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use kind() instead
      The type element kind.

      Such as

      Returns:
      the type kind
      See Also:
    • kind

      public Optional<ElementKind> kind()
      Returns:
      the kind
    • elementInfo

      public List<TypedElementInfo> elementInfo()
      The elements that make up the type that are relevant for processing.
      Returns:
      the element info
    • otherElementInfo

      public List<TypedElementInfo> otherElementInfo()
      The elements that make up this type that are considered "other", or being skipped because they are irrelevant to processing.
      Returns:
      the other element info
    • referencedTypeNamesToAnnotations

      public Map<TypeName,List<Annotation>> referencedTypeNamesToAnnotations()
      Any Map, List, Set, or method that has TypeNameBlueprint.typeArguments() will be analyzed and any type arguments will have its annotations added here. Note that this only applies to non-built-in types.
      Returns:
      the referenced type names to annotations
    • referencedModuleNames

      public Map<TypeName,String> referencedModuleNames()
      Populated if the (external) module name containing the type is known.
      Returns:
      the referenced module names
    • superTypeInfo

      public Optional<TypeInfo> superTypeInfo()
      The parent/super class for this type info.
      Returns:
      the super type info
    • interfaceTypeInfo

      public List<TypeInfo> interfaceTypeInfo()
      The interface classes for this type info.
      Returns:
      the interface type info
    • modifiers

      @Deprecated(since="4.1.0", forRemoval=true) public Set<String> modifiers()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use elementModifiers() instead
      Element modifiers.
      Returns:
      the modifiers
      See Also:
    • elementModifiers

      public Set<Modifier> elementModifiers()
      Type modifiers.
      Returns:
      the element modifiers
      See Also:
    • accessModifier

      public Optional<AccessModifier> accessModifier()
      Access modifier.
      Returns:
      the access modifier
    • module

      public Optional<String> module()
      Module of this type, if available.
      Returns:
      the module
    • 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:
      the 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 annotations
    • 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.

      Returns:
      the inherited annotations
    • toString

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

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

      protected void validatePrototype()
      Validates required properties.