Class RuntimeExceptionSpecBuilder
-
- All Implemented Interfaces:
-
io.toolisticon.kotlin.generation.Builder
,io.toolisticon.kotlin.generation.BuilderSupplier
,io.toolisticon.kotlin.generation.builder.DelegatingBuilder
,io.toolisticon.kotlin.generation.builder.KotlinAnnotatableBuilder
,io.toolisticon.kotlin.generation.builder.KotlinAnnotatableDocumentableModifiableBuilder
,io.toolisticon.kotlin.generation.builder.KotlinConstructorPropertySupport
,io.toolisticon.kotlin.generation.builder.KotlinDocumentableBuilder
,io.toolisticon.kotlin.generation.builder.KotlinGeneratorTypeSpecBuilder
,io.toolisticon.kotlin.generation.builder.KotlinModifiableBuilder
,io.toolisticon.kotlin.generation.builder.KotlinSuperInterfaceSupport
,io.toolisticon.kotlin.generation.builder.KotlinTaggableBuilder
,io.toolisticon.kotlin.generation.poet.PoetSpecSupplier
,io.toolisticon.kotlin.generation.poet.TypeSpecSupplier
,io.toolisticon.kotlin.generation.spec.KotlinGeneratorSpecSupplier
,java.util.function.Supplier
public final class RuntimeExceptionSpecBuilder implements KotlinGeneratorTypeSpecBuilder<RuntimeExceptionSpecBuilder, KotlinClassSpec>, KotlinAnnotatableDocumentableModifiableBuilder<RuntimeExceptionSpecBuilder>, KotlinConstructorPropertySupport<RuntimeExceptionSpecBuilder>, KotlinSuperInterfaceSupport<RuntimeExceptionSpecBuilder>
Builder for a special io.toolisticon.kotlin.generation.spec.KotlinClassSpec that represents an RuntimeException with String-Message-Template.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
RuntimeExceptionSpecBuilder.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static RuntimeExceptionSpecBuilder.Companion
Companion
-
Method Summary
Modifier and Type Method Description final RuntimeExceptionSpecBuilder
messageTemplate(String messageTemplate)
Sets a string message template. final RuntimeExceptionSpecBuilder
addParameter(String name, KClass<?> type)
Define the type of a placeholder parameter in the message template. final RuntimeExceptionSpecBuilder
addParameter(String name, TypeName type)
Define the type of a placeholder parameter in the message template. final RuntimeExceptionSpecBuilder
includeCause(String name)
Include the cause (Throwable) in the constructor. KotlinClassSpec
build()
RuntimeExceptionSpecBuilder
addAnnotation(KotlinAnnotationSpecSupplier spec)
Implementing builder needs to store the spec provided and apply it to the build. RuntimeExceptionSpecBuilder
addConstructorProperty(KotlinConstructorPropertySpecSupplier spec)
Implementing builder needs to store the spec provided and apply it to the build. RuntimeExceptionSpecBuilder
addKdoc(KDoc kdoc)
Implementing builders have to add this to their build. RuntimeExceptionSpecBuilder
addModifiers(KModifier modifiers)
Add modifiers. RuntimeExceptionSpecBuilder
addSuperinterface(TypeName superinterface, String constructorParameter)
RuntimeExceptionSpecBuilder
addSuperinterface(TypeName superinterface, CodeBlock delegate)
RuntimeExceptionSpecBuilder
addTag(KClass<?> type, Object tag)
RuntimeExceptionSpecBuilder
builder(Function1<TypeSpec.Builder, Unit> block)
-
Methods inherited from class io.toolisticon.kotlin.generation.builder.KotlinAnnotatableBuilder
addAnnotation, addAnnotation, addAnnotation, addAnnotation
-
Methods inherited from class io.toolisticon.kotlin.generation.builder.KotlinConstructorPropertySupport
addConstructorProperty, addConstructorProperty
-
Methods inherited from class io.toolisticon.kotlin.generation.builder.KotlinDocumentableBuilder
addKDoc, addKdoc, addKdoc
-
Methods inherited from class io.toolisticon.kotlin.generation.builder.KotlinModifiableBuilder
addModifiers, makeAbstract, makePrivate
-
Methods inherited from class io.toolisticon.kotlin.generation.builder.KotlinSuperInterfaceSupport
addSuperinterface, addSuperinterface, addSuperinterfaces
-
Methods inherited from class io.toolisticon.kotlin.generation.builder.KotlinTaggableBuilder
addTag, removeTag
-
Methods inherited from class io.toolisticon.kotlin.generation.builder.KotlinGeneratorTypeSpecBuilder
get, spec
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
messageTemplate
final RuntimeExceptionSpecBuilder messageTemplate(String messageTemplate)
Sets a string message template. Placeholders
\$foo
are parsed and automatically used as parameters of typeAny
, unless explicitly overwritten byaddParameter
oraddConstructorProperty
.
-
addParameter
final RuntimeExceptionSpecBuilder addParameter(String name, KClass<?> type)
Define the type of a placeholder parameter in the message template.
-
addParameter
final RuntimeExceptionSpecBuilder addParameter(String name, TypeName type)
Define the type of a placeholder parameter in the message template.
-
includeCause
final RuntimeExceptionSpecBuilder includeCause(String name)
Include the cause (Throwable) in the constructor.
-
build
KotlinClassSpec build()
-
addAnnotation
RuntimeExceptionSpecBuilder addAnnotation(KotlinAnnotationSpecSupplier spec)
Implementing builder needs to store the spec provided and apply it to the build.
-
addConstructorProperty
RuntimeExceptionSpecBuilder addConstructorProperty(KotlinConstructorPropertySpecSupplier spec)
Implementing builder needs to store the spec provided and apply it to the build.
-
addKdoc
RuntimeExceptionSpecBuilder addKdoc(KDoc kdoc)
Implementing builders have to add this to their build.
-
addModifiers
RuntimeExceptionSpecBuilder addModifiers(KModifier modifiers)
Add modifiers.
Implementing builders have to add this to their build.
-
addSuperinterface
RuntimeExceptionSpecBuilder addSuperinterface(TypeName superinterface, String constructorParameter)
-
addSuperinterface
RuntimeExceptionSpecBuilder addSuperinterface(TypeName superinterface, CodeBlock delegate)
-
addTag
RuntimeExceptionSpecBuilder addTag(KClass<?> type, Object tag)
-
builder
RuntimeExceptionSpecBuilder builder(Function1<TypeSpec.Builder, Unit> block)
-
-
-
-