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. This method disables automatic service discovery.
      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. This type name represents the type usage of this type (obtained from TypeInfo.superTypeInfo() or TypeInfo.interfaceTypeInfo()). In case this is a type info created from TypeName, this will be the type name returned.
      Parameters:
      typeName - the type name
      Returns:
      updated builder instance
      See Also:
    • typeName

      public BUILDER typeName(Consumer<TypeName.Builder> consumer)
      The type name. This type name represents the type usage of this type (obtained from TypeInfo.superTypeInfo() or TypeInfo.interfaceTypeInfo()). In case this is a type info created from TypeName, this will be the type name returned.
      Parameters:
      consumer - consumer of builder of the type name
      Returns:
      updated builder instance
      See Also:
    • typeName

      public BUILDER typeName(Supplier<? extends TypeName> supplier)
      The type name. This type name represents the type usage of this type (obtained from TypeInfo.superTypeInfo() or TypeInfo.interfaceTypeInfo()). In case this is a type info created from TypeName, this will be the type name returned.
      Parameters:
      supplier - supplier of the type name
      Returns:
      updated builder instance
      See Also:
    • rawType

      public BUILDER rawType(TypeName rawType)
      The raw type name. This is a unique identification of a type, containing ONLY:
      Parameters:
      rawType - raw type of this type info
      Returns:
      updated builder instance
      See Also:
    • rawType

      public BUILDER rawType(Consumer<TypeName.Builder> consumer)
      The raw type name. This is a unique identification of a type, containing ONLY:
      Parameters:
      consumer - consumer of builder of raw type of this type info
      Returns:
      updated builder instance
      See Also:
    • rawType

      public BUILDER rawType(Supplier<? extends TypeName> supplier)
      The raw type name. This is a unique identification of a type, containing ONLY:
      Parameters:
      supplier - supplier of raw type of this type info
      Returns:
      updated builder instance
      See Also:
    • declaredType

      public BUILDER declaredType(TypeName declaredType)
      The declared type name, including type parameters.
      Parameters:
      declaredType - type name with declared type parameters
      Returns:
      updated builder instance
      See Also:
    • declaredType

      public BUILDER declaredType(Consumer<TypeName.Builder> consumer)
      The declared type name, including type parameters.
      Parameters:
      consumer - consumer of builder of type name with declared type parameters
      Returns:
      updated builder instance
      See Also:
    • declaredType

      public BUILDER declaredType(Supplier<? extends TypeName> supplier)
      The declared type name, including type parameters.
      Parameters:
      supplier - supplier of type name with declared type parameters
      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:
    • 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.
      This option is deprecated, 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:
    • clearElementInfo

      public BUILDER clearElementInfo()
      Clear all elementInfo.
      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 - add single 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 - consumer of builder for the elements that make up the type that are relevant for processing
      Returns:
      updated builder instance
      See Also:
    • clearOtherElementInfo

      public BUILDER clearOtherElementInfo()
      Clear all otherElementInfo.
      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 - add single 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 - consumer of builder for 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)
      Any Map, List, Set, or method that has TypeName.typeArguments() will be analyzed and any type arguments will have its annotations added here. Note that this only applies to non-built-in types. 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)
      Any Map, List, Set, or method that has TypeName.typeArguments() will be analyzed and any type arguments will have its annotations added here. Note that this only applies to non-built-in types. 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)
      Any Map, List, Set, or method that has TypeName.typeArguments() will be analyzed and any type arguments will have its annotations added here. Note that this only applies to non-built-in types. This method adds a new value to the map value, or creates a new value.
      Parameters:
      key - key to add value for
      referencedTypeNamesToAnnotation - value to add to the map values
      Returns:
      updated builder instance
      See Also:
    • addReferencedTypeNamesToAnnotations

      public BUILDER addReferencedTypeNamesToAnnotations(TypeName key, List<Annotation> referencedTypeNamesToAnnotations)
      Any Map, List, Set, or method that has TypeName.typeArguments() will be analyzed and any type arguments will have its annotations added here. Note that this only applies to non-built-in types. This method adds new values to the map values, or creates a new mapping.
      Parameters:
      key - key to add value for
      referencedTypeNamesToAnnotations - values to add to the map values
      Returns:
      updated builder instance
      See Also:
    • putReferencedTypeNamesToAnnotation

      public BUILDER putReferencedTypeNamesToAnnotation(TypeName key, List<Annotation> referencedTypeNamesToAnnotation)
      Any Map, List, Set, or method that has TypeName.typeArguments() will be analyzed and any type arguments will have its annotations added here. Note that this only applies to non-built-in types. 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,String> referencedModuleNames)
      Populated if the (external) module name containing the type is known. 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,String> referencedModuleNames)
      Populated if the (external) module name containing the type is known. 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)
      Populated if the (external) module name containing the type is known. 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 superTypeInfo.
      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 - consumer of builder of the super type
      Returns:
      updated builder instance
      See Also:
    • superTypeInfo

      public BUILDER superTypeInfo(Supplier<? extends TypeInfo> supplier)
      The parent/super class for this type info.
      Parameters:
      supplier - supplier of the super type
      Returns:
      updated builder instance
      See Also:
    • clearInterfaceTypeInfo

      public BUILDER clearInterfaceTypeInfo()
      Clear all interfaceTypeInfo.
      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 - add single 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 - consumer of builder for the interface type info
      Returns:
      updated builder instance
      See Also:
    • clearModifiers

      @Deprecated(since="4.1.0", forRemoval=true) public BUILDER clearModifiers()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This option is deprecated, use elementModifiers instead
      Clear all modifiers.
      Returns:
      updated builder instance
      See Also:
    • modifiers

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

      @Deprecated(since="4.1.0", forRemoval=true) public BUILDER addModifiers(Set<String> modifiers)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This option is deprecated, use elementModifiers instead
      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.
      This option is deprecated, use elementModifiers instead
      Element modifiers.
      Parameters:
      modifier - add single element modifiers
      Returns:
      updated builder instance
      See Also:
    • clearElementModifiers

      public BUILDER clearElementModifiers()
      Clear all elementModifiers.
      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 - add single 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 module.
      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 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:
    • typeName

      public Optional<TypeName> typeName()
      The type name. This type name represents the type usage of this type (obtained from TypeInfo.superTypeInfo() or TypeInfo.interfaceTypeInfo()). In case this is a type info created from TypeName, this will be the type name returned.
      Returns:
      the type name
    • rawType

      public Optional<TypeName> rawType()
      The raw type name. This is a unique identification of a type, containing ONLY:
      Returns:
      raw type of this type info
    • declaredType

      public Optional<TypeName> declaredType()
      The declared type name, including type parameters.
      Returns:
      type name with declared type parameters
    • description

      public Optional<String> description()
      Description, such as javadoc, if available.
      Returns:
      description of this element
    • 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.
      This option is deprecated, use kind instead
      The type element kind.

      Such as

      Returns:
      the type element kind.
      See Also:
    • kind

      public Optional<ElementKind> kind()
      Returns:
      element kind of this type
    • elementInfo

      public List<TypedElementInfo> elementInfo()
      The elements that make up the type that are relevant for processing.
      Returns:
      the elements that make up the type that are relevant for processing
    • 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 elements that still make up the type, but are otherwise deemed irrelevant for processing
    • referencedTypeNamesToAnnotations

      public Map<TypeName,List<Annotation>> referencedTypeNamesToAnnotations()
      Any Map, List, Set, or method that has TypeName.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:
      all referenced types
    • referencedModuleNames

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

      public Optional<TypeInfo> superTypeInfo()
      The parent/super class for this type info.
      Returns:
      the super type
    • 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.
      This option is deprecated, use elementModifiers instead
      Element modifiers.
      Returns:
      element modifiers
      See Also:
    • elementModifiers

      public Set<Modifier> elementModifiers()
      Type modifiers.
      Returns:
      set of modifiers that are present on the type (and that we understand)
      See Also:
    • accessModifier

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

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