Class KotlinPropertyDeclaration.AccessorBuilder<T extends KotlinPropertyDeclaration.Builder<T>>
java.lang.Object
io.spring.initializr.generator.language.kotlin.KotlinPropertyDeclaration.AccessorBuilder<T>
- Type Parameters:
T
- the type of builder
- Enclosing class:
- KotlinPropertyDeclaration
public static final class KotlinPropertyDeclaration.AccessorBuilder<T extends KotlinPropertyDeclaration.Builder<T>>
extends Object
Builder for a property accessor.
-
Method Summary
Modifier and TypeMethodDescriptionBuilds the accessor.withAnnotation
(ClassName className) Adds an annotation.withAnnotation
(ClassName className, Consumer<Annotation.Builder> annotation) Adds an annotation.Sets the body.
-
Method Details
-
withAnnotation
Adds an annotation.- Parameters:
className
- the class name of the annotation- Returns:
- this for method chaining
-
withAnnotation
public KotlinPropertyDeclaration.AccessorBuilder<?> withAnnotation(ClassName className, Consumer<Annotation.Builder> annotation) Adds an annotation.- Parameters:
className
- the class name of the annotationannotation
- configurer for the annotation- Returns:
- this for method chaining
-
withBody
Sets the body.- Parameters:
code
- the code for the body- Returns:
- this for method chaining
-
buildAccessor
Builds the accessor.- Returns:
- the parent getter / setter
-