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
-
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) addEnumConstant(Consumer<EnumConstant.Builder> builderConsumer) Add an enum constant (only valid if the class type is set to ENUM.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.addPermittedSubclass(TypeName permittedSubclass) Add a permitted direct subclass of this sealed type.addPermittedSubclass(Class<?> permittedSubclass) Add a permitted direct subclass of this sealed type.addPermittedSubclass(String permittedSubclass) Add a permitted direct subclass of this sealed type.addStaticImport(String staticImport) Add specific static import.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.sealed(boolean sealed) Whether this type is sealed.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.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
-
sealed
Whether this type is sealed.- Parameters:
sealed- whether this type is sealed- Returns:
- updated builder instance
-
superType
-
superType
-
superType
-
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
-
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
-
addInterface
-
addInterface
-
addInterface
-
addPermittedSubclass
-
addPermittedSubclass
-
addPermittedSubclass
-
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
-
addImport
-
addImport
-
addStaticImport
-
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
-
addEnumConstant
Add an enum constant (only valid if the class type is set to ENUM.- Parameters:
builderConsumer- consumer of field builder, type does not have to be specified.- Returns:
- updated builder
-
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
-