Package com.hendraanggrian.kotlinpoet

Types

AnnotationSpecBuilder
Link copied to clipboard
class AnnotationSpecBuilder
Wrapper of AnnotationSpec.Builder, providing DSL support as a replacement to Java builder.
CodeBlockBuilder
Link copied to clipboard
class CodeBlockBuilder : CodeBlockHandler
Wrapper of CodeBlock.Builder, providing DSL support as a replacement to Java builder.
FileSpecBuilder
Link copied to clipboard
class FileSpecBuilder
Wrapper of FileSpec.Builder, providing DSL support as a replacement to Java builder.
FunSpecBuilder
Link copied to clipboard
class FunSpecBuilder : CodeBlockHandler
Wrapper of FunSpec.Builder, providing DSL support as a replacement to Java builder.
ParameterSpecBuilder
Link copied to clipboard
class ParameterSpecBuilder
Wrapper of ParameterSpec.Builder, providing DSL support as a replacement to Java builder.
PropertySpecBuilder
Link copied to clipboard
class PropertySpecBuilder
Wrapper of PropertySpec.Builder, providing DSL support as a replacement to Java builder.
SpecDslMarker
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class SpecDslMarker
Delimits spec builders' DSL.
TypeAliasSpecBuilder
Link copied to clipboard
class TypeAliasSpecBuilder
Wrapper of TypeAliasSpec.Builder, providing DSL support as a replacement to Java builder.
TypeSpecBuilder
Link copied to clipboard
class TypeSpecBuilder
Wrapper of TypeSpec.Builder, providing DSL support as a replacement to Java builder.

Functions

annotate
Link copied to clipboard
inline fun <T : Annotation> ClassName.annotate(): ClassName
Return a copy of ClassName annotated with T.
inline fun <T : Annotation> LambdaTypeName.annotate(): LambdaTypeName
Return a copy of LambdaTypeName annotated with T.
inline fun <T : Annotation> ParameterizedTypeName.annotate(): ParameterizedTypeName
Return a copy of ParameterizedTypeName annotated with T.
inline fun <T : Annotation> TypeName.annotate(): TypeName
Return a copy of TypeName annotated with T.
inline fun <T : Annotation> TypeVariableName.annotate(): TypeVariableName
Return a copy of TypeVariableName annotated with T.
inline fun <T : Annotation> WildcardTypeName.annotate(): WildcardTypeName
Return a copy of WildcardTypeName annotated with T.
inline fun <T : Annotation> Class<*>.annotate(): ClassName
Return a copy of ClassName converted from Class annotated with T.
inline fun <T : Annotation> Type.annotate(): TypeName
Return a copy of TypeName converted from Type annotated with T.
inline fun <T : Annotation> KClass<*>.annotate(): ClassName
Return a copy of ClassName converted from KClass annotated with T.
fun ClassName.annotate(vararg specs: AnnotationSpec): ClassName
Return a copy of ClassName annotated with a set of AnnotationSpec.
fun ClassName.annotate(vararg types: ClassName): ClassName
Return a copy of ClassName annotated with a set of ClassName.
fun ClassName.annotate(vararg types: Class<out Annotation>): ClassName
Return a copy of ClassName annotated with a set of Class.
fun ClassName.annotate(vararg types: KClass<out Annotation>): ClassName
Return a copy of ClassName annotated with a set of KClass.
fun LambdaTypeName.annotate(vararg specs: AnnotationSpec): LambdaTypeName
Return a copy of LambdaTypeName annotated with a set of AnnotationSpec.
fun LambdaTypeName.annotate(vararg types: ClassName): LambdaTypeName
Return a copy of LambdaTypeName annotated with a set of ClassName.
fun LambdaTypeName.annotate(vararg types: Class<out Annotation>): LambdaTypeName
Return a copy of LambdaTypeName annotated with a set of Class.
fun LambdaTypeName.annotate(vararg types: KClass<out Annotation>): LambdaTypeName
Return a copy of LambdaTypeName annotated with a set of KClass.
fun ParameterizedTypeName.annotate(vararg specs: AnnotationSpec): ParameterizedTypeName
Return a copy of ParameterizedTypeName annotated with a set of AnnotationSpec.
fun ParameterizedTypeName.annotate(vararg types: ClassName): ParameterizedTypeName
Return a copy of ParameterizedTypeName annotated with a set of ClassName.
fun ParameterizedTypeName.annotate(vararg types: Class<out Annotation>): ParameterizedTypeName
Return a copy of ParameterizedTypeName annotated with a set of Class.
fun ParameterizedTypeName.annotate(vararg types: KClass<out Annotation>): ParameterizedTypeName
Return a copy of ParameterizedTypeName annotated with a set of KClass.
fun TypeName.annotate(vararg specs: AnnotationSpec): TypeName
Return a copy of TypeName annotated with a set of AnnotationSpec.
fun TypeName.annotate(vararg types: ClassName): TypeName
Return a copy of TypeName annotated with a set of ClassName.
fun TypeName.annotate(vararg types: Class<out Annotation>): TypeName
Return a copy of TypeName annotated with a set of Class.
fun TypeName.annotate(vararg types: KClass<out Annotation>): TypeName
Return a copy of TypeName annotated with a set of KClass.
fun TypeVariableName.annotate(vararg specs: AnnotationSpec): TypeVariableName
Return a copy of TypeVariableName annotated with a set of AnnotationSpec.
fun TypeVariableName.annotate(vararg types: ClassName): TypeVariableName
Return a copy of TypeVariableName annotated with a set of ClassName.
fun TypeVariableName.annotate(vararg types: Class<out Annotation>): TypeVariableName
Return a copy of TypeVariableName annotated with a set of Class.
fun TypeVariableName.annotate(vararg types: KClass<out Annotation>): TypeVariableName
Return a copy of TypeVariableName annotated with a set of KClass.
fun WildcardTypeName.annotate(vararg specs: AnnotationSpec): WildcardTypeName
Return a copy of WildcardTypeName annotated with a set of AnnotationSpec.
fun WildcardTypeName.annotate(vararg types: ClassName): WildcardTypeName
Return a copy of WildcardTypeName annotated with a set of ClassName.
fun WildcardTypeName.annotate(vararg types: Class<out Annotation>): WildcardTypeName
Return a copy of WildcardTypeName annotated with a set of Class.
fun WildcardTypeName.annotate(vararg types: KClass<out Annotation>): WildcardTypeName
Return a copy of WildcardTypeName annotated with a set of KClass.
inline fun Class<*>.annotate(vararg specs: AnnotationSpec): ClassName
Return a copy of ClassName converted from Class annotated with a set of AnnotationSpec.
inline fun Class<*>.annotate(vararg types: ClassName): ClassName
Return a copy of ClassName converted from Class annotated with a set of ClassName.
inline fun Class<*>.annotate(vararg types: Class<out Annotation>): ClassName
Return a copy of ClassName converted from Class annotated with a set of Class.
inline fun Class<*>.annotate(vararg types: KClass<out Annotation>): ClassName
Return a copy of ClassName converted from Class annotated with a set of KClass.
inline fun Type.annotate(vararg specs: AnnotationSpec): TypeName
Return a copy of TypeName converted from Type annotated with a set of AnnotationSpec.
inline fun Type.annotate(vararg types: ClassName): TypeName
Return a copy of TypeName converted from Type annotated with a set of ClassName.
inline fun Type.annotate(vararg types: Class<out Annotation>): TypeName
Return a copy of TypeName converted from Type annotated with a set of Class.
inline fun Type.annotate(vararg types: KClass<out Annotation>): TypeName
Return a copy of TypeName converted from Type annotated with a set of KClass.
inline fun KClass<*>.annotate(vararg specs: AnnotationSpec): ClassName
Return a copy of ClassName converted from KClass annotated with a set of AnnotationSpec.
inline fun KClass<*>.annotate(vararg types: ClassName): ClassName
Return a copy of ClassName converted from KClass annotated with a set of ClassName.
inline fun KClass<*>.annotate(vararg types: Class<out Annotation>): ClassName
Return a copy of ClassName converted from KClass annotated with a set of Class.
inline fun KClass<*>.annotate(vararg types: KClass<out Annotation>): ClassName
Return a copy of ClassName converted from KClass annotated with a set of KClass.
annotationSpecOf
Link copied to clipboard
inline fun <T : Annotation> annotationSpecOf(): AnnotationSpec
Builds new AnnotationSpec from T.
fun annotationSpecOf(type: ClassName): AnnotationSpec
Builds new AnnotationSpec from ClassName.
fun annotationSpecOf(type: ParameterizedTypeName): AnnotationSpec
Builds new AnnotationSpec from ParameterizedTypeName.
fun annotationSpecOf(type: Class<out Annotation>): AnnotationSpec
Builds new AnnotationSpec from Class.
fun annotationSpecOf(type: KClass<out Annotation>): AnnotationSpec
Builds new AnnotationSpec from KClass.
annotationTypeSpecOf
Link copied to clipboard
fun annotationTypeSpecOf(type: ClassName): TypeSpec
Builds new annotation TypeSpec from ClassName.
fun annotationTypeSpecOf(type: String): TypeSpec
Builds new annotation TypeSpec from name.
asAnnotationSpec
Link copied to clipboard
fun Annotation.asAnnotationSpec(includeDefaultValues: Boolean = false): AnnotationSpec
Converts Annotation to AnnotationSpec.
asNotNull
Link copied to clipboard
fun ClassName.asNotNull(): ClassName
Return a non-nullable copy of ClassName.
fun LambdaTypeName.asNotNull(): LambdaTypeName
Return a non-nullable copy of LambdaTypeName.
fun ParameterizedTypeName.asNotNull(): ParameterizedTypeName
Return a non-nullable copy of ParameterizedTypeName.
fun TypeName.asNotNull(): TypeName
Return a non-nullable copy of TypeName.
fun TypeVariableName.asNotNull(): TypeVariableName
Return a non-nullable copy of TypeVariableName.
fun WildcardTypeName.asNotNull(): WildcardTypeName
Return a non-nullable copy of WildcardTypeName.
inline fun Class<*>.asNotNull(): ClassName
Return a non-nullable copy of ClassName converted from Class.
inline fun Type.asNotNull(): TypeName
Return a non-nullable copy of TypeName converted from Type.
inline fun KClass<*>.asNotNull(): ClassName
Return a non-nullable copy of ClassName converted from KClass.
asNullable
Link copied to clipboard
fun ClassName.asNullable(): ClassName
Return a nullable copy of ClassName.
fun LambdaTypeName.asNullable(): LambdaTypeName
Return a nullable copy of LambdaTypeName.
fun ParameterizedTypeName.asNullable(): ParameterizedTypeName
Return a nullable copy of ParameterizedTypeName.
fun TypeName.asNullable(): TypeName
Return a nullable copy of TypeName.
fun TypeVariableName.asNullable(): TypeVariableName
Return a nullable copy of TypeVariableName.
fun WildcardTypeName.asNullable(): WildcardTypeName
Return a nullable copy of WildcardTypeName.
inline fun Class<*>.asNullable(): ClassName
Return a nullable copy of ClassName converted from Class.
inline fun Type.asNullable(): TypeName
Return a nullable copy of TypeName converted from Type.
inline fun KClass<*>.asNullable(): ClassName
Return a nullable copy of ClassName converted from KClass.
buildAnnotationSpec
Link copied to clipboard
inline fun <T : Annotation> buildAnnotationSpec(noinline configuration: AnnotationSpecBuilder.() -> Unit): AnnotationSpec
Builds new AnnotationSpec from T, by populating newly created AnnotationSpecBuilder using provided configuration.
fun buildAnnotationSpec(type: ClassName, configuration: AnnotationSpecBuilder.() -> Unit): AnnotationSpec
Builds new AnnotationSpec from ClassName, by populating newly created AnnotationSpecBuilder using provided configuration.
fun buildAnnotationSpec(type: ParameterizedTypeName, configuration: AnnotationSpecBuilder.() -> Unit): AnnotationSpec
Builds new AnnotationSpec from ParameterizedTypeName, by populating newly created AnnotationSpecBuilder using provided configuration.
fun buildAnnotationSpec(type: Class<out Annotation>, configuration: AnnotationSpecBuilder.() -> Unit): AnnotationSpec
Builds new AnnotationSpec from Class, by populating newly created AnnotationSpecBuilder using provided configuration.
fun buildAnnotationSpec(type: KClass<out Annotation>, configuration: AnnotationSpecBuilder.() -> Unit): AnnotationSpec
Builds new AnnotationSpec from KClass, by populating newly created AnnotationSpecBuilder using provided configuration.
buildAnnotationTypeSpec
Link copied to clipboard
fun buildAnnotationTypeSpec(type: ClassName, configuration: TypeSpecBuilder.() -> Unit): TypeSpec
Builds new annotation TypeSpec from ClassName, by populating newly created TypeSpecBuilder using provided configuration.
fun buildAnnotationTypeSpec(type: String, configuration: TypeSpecBuilder.() -> Unit): TypeSpec
Builds new annotation TypeSpec from name, by populating newly created TypeSpecBuilder using provided configuration.
buildAnonymousTypeSpec
Link copied to clipboard
fun buildAnonymousTypeSpec(configuration: TypeSpecBuilder.() -> Unit): TypeSpec
Builds new anonymous TypeSpec, by populating newly created TypeSpecBuilder using provided configuration.
buildClassTypeSpec
Link copied to clipboard
fun buildClassTypeSpec(type: ClassName, configuration: TypeSpecBuilder.() -> Unit): TypeSpec
Builds new class TypeSpec from ClassName, by populating newly created TypeSpecBuilder using provided configuration.
fun buildClassTypeSpec(type: String, configuration: TypeSpecBuilder.() -> Unit): TypeSpec
Builds new class TypeSpec from name, by populating newly created TypeSpecBuilder using provided configuration.
buildCodeBlock
Link copied to clipboard
fun buildCodeBlock(configuration: CodeBlockBuilder.() -> Unit): CodeBlock
Builds new CodeBlock, by populating newly created CodeBlockBuilder using provided configuration.
buildCompanionObjectTypeSpec
Link copied to clipboard
fun buildCompanionObjectTypeSpec(type: String? = null, configuration: TypeSpecBuilder.() -> Unit): TypeSpec
Builds new object TypeSpec from name, by populating newly created TypeSpecBuilder using provided configuration.
buildConstructorFunSpec
Link copied to clipboard
fun buildConstructorFunSpec(configuration: FunSpecBuilder.() -> Unit): FunSpec
Builds new constructor FunSpec, by populating newly created FunSpecBuilder using provided configuration.
buildEnumTypeSpec
Link copied to clipboard
fun buildEnumTypeSpec(type: ClassName, configuration: TypeSpecBuilder.() -> Unit): TypeSpec
Builds new enum TypeSpec from ClassName, by populating newly created TypeSpecBuilder using provided configuration.
fun buildEnumTypeSpec(type: String, configuration: TypeSpecBuilder.() -> Unit): TypeSpec
Builds new enum TypeSpec from name, by populating newly created TypeSpecBuilder using provided configuration.
buildExpectClassTypeSpec
Link copied to clipboard
fun buildExpectClassTypeSpec(type: ClassName, configuration: TypeSpecBuilder.() -> Unit): TypeSpec
Builds new expect class TypeSpec from ClassName, by populating newly created TypeSpecBuilder using provided configuration.
fun buildExpectClassTypeSpec(type: String, configuration: TypeSpecBuilder.() -> Unit): TypeSpec
Builds new expect class TypeSpec from name, by populating newly created TypeSpecBuilder using provided configuration.
buildFileSpec
Link copied to clipboard
fun buildFileSpec(packageName: String, fileName: String, configuration: FileSpecBuilder.() -> Unit): FileSpec
Builds a new FileSpec, by populating newly created FileSpecBuilder using provided configuration.
buildFunSpec
Link copied to clipboard
fun buildFunSpec(name: String, configuration: FunSpecBuilder.() -> Unit): FunSpec
Builds new FunSpec with name, by populating newly created FunSpecBuilder using provided configuration.
buildGetterFunSpec
Link copied to clipboard
fun buildGetterFunSpec(configuration: FunSpecBuilder.() -> Unit): FunSpec
Builds new getter FunSpec, by populating newly created FunSpecBuilder using provided configuration.
buildInterfaceTypeSpec
Link copied to clipboard
fun buildInterfaceTypeSpec(type: ClassName, configuration: TypeSpecBuilder.() -> Unit): TypeSpec
Builds new interface TypeSpec from ClassName, by populating newly created TypeSpecBuilder using provided configuration.
fun buildInterfaceTypeSpec(type: String, configuration: TypeSpecBuilder.() -> Unit): TypeSpec
Builds new interface TypeSpec from name, by populating newly created TypeSpecBuilder using provided configuration.
buildObjectTypeSpec
Link copied to clipboard
fun buildObjectTypeSpec(type: ClassName, configuration: TypeSpecBuilder.() -> Unit): TypeSpec
Builds new object TypeSpec from ClassName, by populating newly created TypeSpecBuilder using provided configuration.
fun buildObjectTypeSpec(type: String, configuration: TypeSpecBuilder.() -> Unit): TypeSpec
Builds new object TypeSpec from name, by populating newly created TypeSpecBuilder using provided configuration.
buildParameterSpec
Link copied to clipboard
inline fun <T> buildParameterSpec(name: String, vararg modifiers: KModifier, noinline configuration: ParameterSpecBuilder.() -> Unit): ParameterSpec
Builds new ParameterSpec from T, by populating newly created ParameterSpecBuilder using provided configuration.
fun buildParameterSpec(name: String, type: TypeName, vararg modifiers: KModifier, configuration: ParameterSpecBuilder.() -> Unit): ParameterSpec
Builds new ParameterSpec from TypeName, by populating newly created ParameterSpecBuilder using provided configuration.
fun buildParameterSpec(name: String, type: Type, vararg modifiers: KModifier, configuration: ParameterSpecBuilder.() -> Unit): ParameterSpec
Builds new ParameterSpec from Type, by populating newly created ParameterSpecBuilder using provided configuration.
fun buildParameterSpec(name: String, type: KClass<*>, vararg modifiers: KModifier, configuration: ParameterSpecBuilder.() -> Unit): ParameterSpec
Builds new ParameterSpec from KClass, by populating newly created ParameterSpecBuilder using provided configuration.
buildPropertySpec
Link copied to clipboard
inline fun <T> buildPropertySpec(name: String, vararg modifiers: KModifier, noinline configuration: PropertySpecBuilder.() -> Unit): PropertySpec
Builds new PropertySpec from T supplying its name and modifiers, by populating newly created PropertySpecBuilder using provided configuration.
fun buildPropertySpec(name: String, type: TypeName, vararg modifiers: KModifier, configuration: PropertySpecBuilder.() -> Unit): PropertySpec
Builds new PropertySpec from TypeName supplying its name and modifiers, by populating newly created PropertySpecBuilder using provided configuration.
fun buildPropertySpec(name: String, type: Type, vararg modifiers: KModifier, configuration: PropertySpecBuilder.() -> Unit): PropertySpec
Builds new PropertySpec from Type supplying its name and modifiers, by populating newly created PropertySpecBuilder using provided configuration.
fun buildPropertySpec(name: String, type: KClass<*>, vararg modifiers: KModifier, configuration: PropertySpecBuilder.() -> Unit): PropertySpec
Builds new PropertySpec from KClass supplying its name and modifiers, by populating newly created PropertySpecBuilder using provided configuration.
buildSetterFunSpec
Link copied to clipboard
fun buildSetterFunSpec(configuration: FunSpecBuilder.() -> Unit): FunSpec
Builds new setter FunSpec, by populating newly created FunSpecBuilder using provided configuration.
buildTypeAliasSpec
Link copied to clipboard
inline fun <T> buildTypeAliasSpec(name: String, noinline configuration: TypeAliasSpecBuilder.() -> Unit): TypeAliasSpec
Builds new TypeAliasSpec from name and T, by populating newly created TypeAliasSpecBuilder using provided configuration.
fun buildTypeAliasSpec(name: String, type: TypeName, configuration: TypeAliasSpecBuilder.() -> Unit): TypeAliasSpec
Builds new TypeAliasSpec from name and TypeName, by populating newly created TypeAliasSpecBuilder using provided configuration.
fun buildTypeAliasSpec(name: String, type: Type, configuration: TypeAliasSpecBuilder.() -> Unit): TypeAliasSpec
Builds new TypeAliasSpec from name and Type, by populating newly created TypeAliasSpecBuilder using provided configuration.
fun buildTypeAliasSpec(name: String, type: KClass<*>, configuration: TypeAliasSpecBuilder.() -> Unit): TypeAliasSpec
Builds new TypeAliasSpec from name and KClass, by populating newly created TypeAliasSpecBuilder using provided configuration.
classOf
Link copied to clipboard
inline fun String.classOf(vararg simpleNames: String): ClassName
Returns a ClassName created from the given parts.
classTypeSpecOf
Link copied to clipboard
fun classTypeSpecOf(type: ClassName): TypeSpec
Builds new class TypeSpec from ClassName.
fun classTypeSpecOf(type: String): TypeSpec
Builds new class TypeSpec from name.
codeBlockOf
Link copied to clipboard
fun codeBlockOf(format: String, vararg args: Any): CodeBlock
Converts string to CodeBlock using formatted args.
companionObjectTypeSpecOf
Link copied to clipboard
fun companionObjectTypeSpecOf(type: String? = null): TypeSpec
Builds new companion object TypeSpec from name.
edit
Link copied to clipboard
fun AnnotationSpec.Builder.edit(configuration: AnnotationSpecBuilder.() -> Unit): AnnotationSpec.Builder
Modify existing AnnotationSpec.Builder using provided configuration.
fun CodeBlock.Builder.edit(configuration: CodeBlockBuilder.() -> Unit): CodeBlock.Builder
Modify existing CodeBlock.Builder using provided configuration.
fun FileSpec.Builder.edit(configuration: FileSpecBuilder.() -> Unit): FileSpec.Builder
Modify existing FileSpec.Builder using provided configuration.
fun FunSpec.Builder.edit(configuration: FunSpecBuilder.() -> Unit): FunSpec.Builder
Modify existing FunSpec.Builder using provided configuration.
fun ParameterSpec.Builder.edit(configuration: ParameterSpecBuilder.() -> Unit): ParameterSpec.Builder
Modify existing ParameterSpec.Builder using provided configuration.
fun PropertySpec.Builder.edit(configuration: PropertySpecBuilder.() -> Unit): PropertySpec.Builder
Modify existing PropertySpec.Builder using provided configuration.
fun TypeAliasSpec.Builder.edit(configuration: TypeAliasSpecBuilder.() -> Unit): TypeAliasSpec.Builder
Modify existing TypeAliasSpec.Builder using provided configuration.
fun TypeSpec.Builder.edit(configuration: TypeSpecBuilder.() -> Unit): TypeSpec.Builder
Modify existing TypeSpec.Builder using provided configuration.
emptyAnonymousTypeSpec
Link copied to clipboard
fun emptyAnonymousTypeSpec(): TypeSpec
Builds new anonymous TypeSpec.
emptyConstructorFunSpec
Link copied to clipboard
fun emptyConstructorFunSpec(): FunSpec
Builds new constructor FunSpec.
emptyGetterFunSpec
Link copied to clipboard
fun emptyGetterFunSpec(): FunSpec
Builds new getter FunSpec.
emptySetterFunSpec
Link copied to clipboard
fun emptySetterFunSpec(): FunSpec
Builds new setter FunSpec.
enumTypeSpecOf
Link copied to clipboard
fun enumTypeSpecOf(type: ClassName): TypeSpec
Builds new enum TypeSpec from ClassName.
fun enumTypeSpecOf(type: String): TypeSpec
Builds new enum TypeSpec from name.
expectClassTypeSpecOf
Link copied to clipboard
fun expectClassTypeSpecOf(type: ClassName): TypeSpec
Builds new expect class TypeSpec from ClassName.
fun expectClassTypeSpecOf(type: String): TypeSpec
Builds expect new class TypeSpec from name.
fileSpecOf
Link copied to clipboard
fun fileSpecOf(type: TypeSpec, packageName: String): FileSpec
Converts type to FileSpec.
funSpecOf
Link copied to clipboard
fun funSpecOf(name: String): FunSpec
Builds new FunSpec with name.
interfaceTypeSpecOf
Link copied to clipboard
fun interfaceTypeSpecOf(type: ClassName): TypeSpec
Builds new interface TypeSpec from ClassName.
fun interfaceTypeSpecOf(type: String): TypeSpec
Builds new interface TypeSpec from name.
lambdaBy
Link copied to clipboard
inline fun TypeName.lambdaBy(vararg parameters: ParameterSpec = emptyArray(), receiver: TypeName? = null): LambdaTypeName
Returns a LambdaTypeName with TypeName return type, ParameterSpec parameters and optional TypeName receiver.
inline fun TypeName.lambdaBy(vararg parameters: TypeName, receiver: TypeName? = null): LambdaTypeName
Returns a LambdaTypeName with TypeName return type, TypeName parameters and optional TypeName receiver.
inline fun TypeName.lambdaBy(parameters: List<ParameterSpec>, receiver: TypeName? = null): LambdaTypeName
Returns a LambdaTypeName with TypeName return type, ParameterSpec list parameters and optional TypeName receiver.
fun Type.lambdaBy(vararg parameters: ParameterSpec = emptyArray(), receiver: Type? = null): LambdaTypeName
Returns a LambdaTypeName with Type return type, ParameterSpec parameters and optional Type receiver.
fun Type.lambdaBy(vararg parameters: Type, receiver: Type? = null): LambdaTypeName
Returns a LambdaTypeName with Type return type, Type parameters and optional Type receiver.
fun Type.lambdaBy(parameters: List<ParameterSpec>, receiver: Type? = null): LambdaTypeName
Returns a LambdaTypeName with Type return type, ParameterSpec list parameters and optional Type receiver.
fun KClass<*>.lambdaBy(vararg parameters: ParameterSpec = emptyArray(), receiver: KClass<*>? = null): LambdaTypeName
Returns a LambdaTypeName with KClass return type, ParameterSpec parameters and optional KClass receiver.
fun KClass<*>.lambdaBy(vararg parameters: KClass<*>, receiver: KClass<*>? = null): LambdaTypeName
Returns a LambdaTypeName with KClass return type, KClass parameters and optional KClass receiver.
fun KClass<*>.lambdaBy(parameters: List<ParameterSpec>, receiver: KClass<*>? = null): LambdaTypeName
Returns a LambdaTypeName with KClass return type, ParameterSpec list parameters and optional KClass receiver.
memberOf
Link copied to clipboard
inline fun ClassName.memberOf(simpleName: String): MemberName
Returns a MemberName using enclosing ClassName and target name.
inline fun Class<*>.memberOf(simpleName: String): MemberName
Returns a MemberName using enclosing Class and target name.
inline fun String.memberOf(simpleName: String): MemberName
Returns a MemberName using package and target name.
inline fun KClass<*>.memberOf(simpleName: String): MemberName
Returns a MemberName using enclosing KClass and target name.
objectTypeSpecOf
Link copied to clipboard
fun objectTypeSpecOf(type: ClassName): TypeSpec
Builds new object class TypeSpec from ClassName.
fun objectTypeSpecOf(type: String): TypeSpec
Builds new object TypeSpec from name.
parameterizedBy
Link copied to clipboard
inline fun <T> Class<*>.parameterizedBy(): ParameterizedTypeName
Returns a ParameterizedTypeName applying T argument to Class.
inline fun ClassName.parameterizedBy(vararg typeArguments: TypeName): ParameterizedTypeName
Returns a ParameterizedTypeName applying TypeName arguments to ClassName.
fun ClassName.parameterizedBy(vararg typeArguments: Type = emptyArray()): ParameterizedTypeName
Returns a ParameterizedTypeName applying Type arguments to ClassName.
fun ClassName.parameterizedBy(vararg typeArguments: KClass<*> = emptyArray()): ParameterizedTypeName
Returns a ParameterizedTypeName applying KClass arguments to ClassName.
inline fun ClassName.parameterizedBy(typeArguments: List<TypeName>): ParameterizedTypeName
Returns a ParameterizedTypeName applying TypeName argument list to ClassName.
fun Class<*>.parameterizedBy(vararg typeArguments: TypeName = emptyArray()): ParameterizedTypeName
Returns a ParameterizedTypeName applying TypeName arguments to Class.
inline fun Class<*>.parameterizedBy(vararg typeArguments: Type): ParameterizedTypeName
Returns a ParameterizedTypeName applying Type arguments to Class.
fun Class<*>.parameterizedBy(vararg typeArguments: KClass<*> = emptyArray()): ParameterizedTypeName
Returns a ParameterizedTypeName applying KClass arguments to Class.
inline fun Class<*>.parameterizedBy(typeArguments: Iterable<Type>): ParameterizedTypeName
Returns a ParameterizedTypeName applying Type argument list to Class.
fun KClass<*>.parameterizedBy(vararg typeArguments: TypeName = emptyArray()): ParameterizedTypeName
Returns a ParameterizedTypeName applying TypeName arguments to KClass.
fun KClass<*>.parameterizedBy(vararg typeArguments: Type = emptyArray()): ParameterizedTypeName
Returns a ParameterizedTypeName applying Type arguments to KClass.
inline fun KClass<*>.parameterizedBy(vararg typeArguments: KClass<*>): ParameterizedTypeName
Returns a ParameterizedTypeName applying KClass arguments to KClass.
inline fun KClass<*>.parameterizedBy(typeArguments: Iterable<KClass<*>>): ParameterizedTypeName
Returns a ParameterizedTypeName applying KClass argument list to KClass.
parameterSpecOf
Link copied to clipboard
inline fun <T> parameterSpecOf(name: String, vararg modifiers: KModifier): ParameterSpec
Builds new ParameterSpec from T.
fun parameterSpecOf(name: String, type: TypeName, vararg modifiers: KModifier): ParameterSpec
Builds new ParameterSpec from TypeName.
fun parameterSpecOf(name: String, type: Type, vararg modifiers: KModifier): ParameterSpec
Builds new ParameterSpec from Type.
fun parameterSpecOf(name: String, type: KClass<*>, vararg modifiers: KModifier): ParameterSpec
Builds new ParameterSpec from KClass.
propertySpecOf
Link copied to clipboard
inline fun <T> propertySpecOf(name: String, vararg modifiers: KModifier): PropertySpec
Builds new PropertySpec from T supplying its name and modifiers.
fun propertySpecOf(name: String, type: TypeName, vararg modifiers: KModifier): PropertySpec
Builds new PropertySpec from TypeName supplying its name and modifiers.
fun propertySpecOf(name: String, type: Type, vararg modifiers: KModifier): PropertySpec
Builds new PropertySpec from Type supplying its name and modifiers.
fun propertySpecOf(name: String, type: KClass<*>, vararg modifiers: KModifier): PropertySpec
Builds new PropertySpec from KClass supplying its name and modifiers.
typeAliasSpecOf
Link copied to clipboard
inline fun <T> typeAliasSpecOf(name: String): TypeAliasSpec
Builds new TypeAliasSpec from name and T.
fun typeAliasSpecOf(name: String, type: TypeName): TypeAliasSpec
Builds new TypeAliasSpec from name and TypeName.
fun typeAliasSpecOf(name: String, type: Type): TypeAliasSpec
Builds new TypeAliasSpec from name and Type.
fun typeAliasSpecOf(name: String, type: KClass<*>): TypeAliasSpec
Builds new TypeAliasSpec from name and KClass.
typeVarBy
Link copied to clipboard
inline fun String.typeVarBy(vararg bounds: TypeName, variance: KModifier? = null): TypeVariableName
Returns a TypeVariableName with TypeName bounds.
inline fun String.typeVarBy(vararg bounds: Type, variance: KModifier? = null): TypeVariableName
Returns a TypeVariableName with Type bounds.
inline fun String.typeVarBy(vararg bounds: KClass<*>, variance: KModifier? = null): TypeVariableName
Returns a TypeVariableName with KClass bounds.
typeVarOf
Link copied to clipboard
inline fun String.typeVarOf(variance: KModifier? = null): TypeVariableName
Returns a TypeVariableName without bounds.
wildcardConsumerOf
Link copied to clipboard
inline fun TypeName.wildcardConsumerOf(): WildcardTypeName
Returns a WildcardTypeName that represents an unknown type that consumes TypeName.
inline fun Type.wildcardConsumerOf(): WildcardTypeName
Returns a WildcardTypeName that represents an unknown type that consumes Type.
inline fun KClass<*>.wildcardConsumerOf(): WildcardTypeName
Returns a WildcardTypeName that represents an unknown type that consumes KClass.
wildcardProducerOf
Link copied to clipboard
inline fun TypeName.wildcardProducerOf(): WildcardTypeName
Returns a WildcardTypeName that represents an unknown type that produces TypeName.
inline fun Type.wildcardProducerOf(): WildcardTypeName
Returns a WildcardTypeName that represents an unknown type that produces Type.
inline fun KClass<*>.wildcardProducerOf(): WildcardTypeName
Returns a WildcardTypeName that represents an unknown type that produces KClass.

Properties

ABSTRACT
Link copied to clipboard
val ABSTRACT: KModifier
ACTUAL
Link copied to clipboard
val ACTUAL: KModifier
ANNOTATION
Link copied to clipboard
val ANNOTATION: KModifier
COMPANION
Link copied to clipboard
val COMPANION: KModifier
CONST
Link copied to clipboard
val CONST: KModifier
CROSSINLINE
Link copied to clipboard
val CROSSINLINE: KModifier
DATA
Link copied to clipboard
val DATA: KModifier
ENUM
Link copied to clipboard
val ENUM: KModifier
EXPECT
Link copied to clipboard
val EXPECT: KModifier
EXTERNAL
Link copied to clipboard
val EXTERNAL: KModifier
FINAL
Link copied to clipboard
val FINAL: KModifier
FUN
Link copied to clipboard
val FUN: KModifier
IN
Link copied to clipboard
val IN: KModifier
INFIX
Link copied to clipboard
val INFIX: KModifier
INLINE
Link copied to clipboard
val INLINE: KModifier
INNER
Link copied to clipboard
val INNER: KModifier
INTERNAL
Link copied to clipboard
val INTERNAL: KModifier
LATEINIT
Link copied to clipboard
val LATEINIT: KModifier
NOINLINE
Link copied to clipboard
val NOINLINE: KModifier
OPEN
Link copied to clipboard
val OPEN: KModifier
OPERATOR
Link copied to clipboard
val OPERATOR: KModifier
OUT
Link copied to clipboard
val OUT: KModifier
OVERRIDE
Link copied to clipboard
val OVERRIDE: KModifier
PRIVATE
Link copied to clipboard
val PRIVATE: KModifier
PROTECTED
Link copied to clipboard
val PROTECTED: KModifier
PUBLIC
Link copied to clipboard
val PUBLIC: KModifier
REIFIED
Link copied to clipboard
val REIFIED: KModifier
SEALED
Link copied to clipboard
val SEALED: KModifier
SUSPEND
Link copied to clipboard
val SUSPEND: KModifier
TAILREC
Link copied to clipboard
val TAILREC: KModifier
VARARG
Link copied to clipboard
val VARARG: KModifier