Package io.helidon.codegen.classmodel
Class ClassBase.Builder<B extends ClassBase.Builder<B,T>,T extends ClassBase>
java.lang.Object
io.helidon.codegen.classmodel.ClassBase.Builder<B,T>
- Type Parameters:
B
- builder typeT
- built object type
- Direct Known Subclasses:
ClassModel.Builder
,InnerClass.Builder
- Enclosing class:
ClassBase
public abstract static class ClassBase.Builder<B extends ClassBase.Builder<B,T>,T extends ClassBase>
extends Object
Fluent API builder for
ClassBase
.-
Method Summary
Modifier and TypeMethodDescriptionaccessModifier
(AccessModifier accessModifier) addAnnotation
(Annotation annotation) Add new annotation to the component.addAnnotation
(Annotation.Builder builder) Add new annotation to the component.addAnnotation
(Annotation annotation) Add new annotation to the component.addAnnotation
(Consumer<Annotation.Builder> consumer) Add new annotation to the component.addConstructor
(Constructor.Builder constructor) Add new constructor to this class.addConstructor
(Consumer<Constructor.Builder> consumer) Add new constructor to this class.addDescriptionLine
(String line) Add new field to the type.addField
(Field.Builder builder) Add new field to the type.addField
(Consumer<Field.Builder> consumer) Add new field to the type.addGenericArgument
(TypeArgument typeArgument) Add generic argument type.addGenericArgument
(Consumer<TypeArgument.Builder> consumer) Add generic argument type.Add specific fully qualified type name to be imported.Add specific class to be imported.Add specific fully qualified type name to be imported.addInnerClass
(InnerClass innerClass) Add new inner type to this type.addInnerClass
(Consumer<InnerClass.Builder> consumer) Add new inner type to this type.addInnerClass
(Supplier<InnerClass> supplier) Add new inner type to this type.addInterface
(TypeName interfaceType) Add interface this type should implement.addInterface
(Class<?> interfaceType) Add interface this type should implement.addInterface
(String interfaceName) Add interface this type should implement.addJavadocTag
(String tag, String description) Add new method to the type.addMethod
(Method.Builder builder) Add new method to the type.addMethod
(Consumer<Method.Builder> consumer) Add new method to the type.addStaticImport
(String staticImport) Add specific static import.Type of the Java type we are creating.classType
(ElementKind kind) Type of the Java type we are creating.description
(String description) description
(List<String> description) includeImport
(boolean includeImport) Whether to include import type information among the imports.isAbstract
(boolean isAbstract) Whether this type is abstract.isFinal
(boolean isFinal) Whether this type is final.sortFields
(boolean sort) Whether to sort non-static fields by type and name (defaults totrue
).sortStaticFields
(boolean sort) Whether to sort static fields by type and name (defaults totrue
).Set new super type of this type.Set new super type of this type.Set new fully qualified super type name of this type.
-
Method Details
-
javadoc
-
addJavadocTag
-
accessModifier
-
isFinal
Whether this type is final.- Parameters:
isFinal
- type is abstract- Returns:
- updated builder instance
-
isAbstract
Whether this type is abstract.- Parameters:
isAbstract
- type is abstract- Returns:
- updated builder instance
-
superType
Set new super type of this type.- Parameters:
superType
- super type of this type- Returns:
- updated builder instance
-
superType
Set new fully qualified super type name of this type.- Parameters:
superType
- super type of this type- Returns:
- updated builder instance
-
superType
Set new super type of this type.- Parameters:
superType
- super type of this type- Returns:
- updated builder instance
-
addField
Add new field to the type.- Parameters:
consumer
- field builder consumer- Returns:
- updated builder instance
-
addField
Add new field to the type.- Parameters:
builder
- field builder- Returns:
- updated builder instance
-
addField
Add new field to the type.- Parameters:
field
- new field- Returns:
- updated builder instance
-
addMethod
Add new method to the type.- Parameters:
consumer
- method builder consumer- Returns:
- updated builder instance
-
addMethod
Add new method to the type.- Parameters:
builder
- method builder- Returns:
- updated builder instance
-
addMethod
Add new method to the type.- Parameters:
method
- new method- Returns:
- updated builder instance
-
addInterface
Add interface this type should implement.- Parameters:
interfaceType
- interface type to implement- Returns:
- updated builder instance
-
addInterface
Add interface this type should implement.- Parameters:
interfaceName
- fully qualified interface name to implement- Returns:
- updated builder instance
-
addInterface
Add interface this type should implement.- Parameters:
interfaceType
- interface to implement- Returns:
- updated builder instance
-
addInnerClass
Add new inner type to this type.- Parameters:
consumer
- inner class builder consumer- Returns:
- updated builder instance
-
addInnerClass
Add new inner type to this type.- Parameters:
supplier
- inner class builder supplier- Returns:
- updated builder instance
-
addInnerClass
Add new inner type to this type.- Parameters:
innerClass
- inner class instance- Returns:
- updated builder instance
-
addConstructor
Add new constructor to this class.- Parameters:
constructor
- constructor builder- Returns:
- updated builder instance
-
addConstructor
Add new constructor to this class.- Parameters:
consumer
- constructor builder consumer- Returns:
- updated builder instance
-
addGenericArgument
Add generic argument type.- Parameters:
typeArgument
- generic argument type- Returns:
- updated builder instance
-
addGenericArgument
Add generic argument type.- Parameters:
consumer
- generic argument type builder consumer- Returns:
- updated builder instance
-
addImport
Add specific class to be imported.- Parameters:
typeImport
- type to be included among imports- Returns:
- updated builder instance
-
addImport
Add specific fully qualified type name to be imported.- Parameters:
importName
- type to be included among imports- Returns:
- updated builder instance
-
addImport
Add specific fully qualified type name to be imported.- Parameters:
typeName
- type to be included among imports- Returns:
- updated builder instance
-
addStaticImport
Add specific static import.- Parameters:
staticImport
- fully qualified static import name- Returns:
- updated builder instance
-
classType
Type of the Java type we are creating. For example: class, interface etc.- Parameters:
classType
- Java type- Returns:
- updated builder instance
-
classType
Type of the Java type we are creating. For example: class, interface etc.- Parameters:
kind
- the element kind, must be a supported top level type- Returns:
- updated builder instance
- Throws:
IllegalArgumentException
- in case the kind is not supported
-
sortFields
Whether to sort non-static fields by type and name (defaults totrue
). If set tofalse
, fields are ordered by insertion sequence.- Parameters:
sort
- whether to sort fields- Returns:
- updated builder instance
-
sortStaticFields
Whether to sort static fields by type and name (defaults totrue
). If set tofalse
, fields are ordered by insertion sequence.- Parameters:
sort
- whether to sort fields- Returns:
- updated builder instance
-
description
-
description
-
addDescriptionLine
-
addAnnotation
Add new annotation to the component.- Parameters:
annotation
- annotation instance- Returns:
- updated builder instance
-
addAnnotation
Add new annotation to the component.- Parameters:
consumer
- annotation builder consumer- Returns:
- updated builder instance
-
addAnnotation
Add new annotation to the component.- Parameters:
builder
- annotation builder- Returns:
- updated builder instance
-
addAnnotation
Add new annotation to the component.- Parameters:
annotation
- annotation instance- Returns:
- updated builder instance
-
name
-
includeImport
Whether to include import type information among the imports.- Parameters:
includeImport
- whether imports should be included- Returns:
- updated builder instance
-