Package com. squareup. kotlinpoet
Types
A generated annotation on a declaration.
A fully-qualified class name for top-level and member classes.
A fragment of a .kt file, potentially containing declarations, statements, and documentation. Code blocks are not necessarily well-formed Kotlin code, and are not validated. This class assumes kotlinc will check correctness later!
Marks declarations in the KotlinPoet API that are delicate — they have limited use-case and shall be used with care in general code. Any use of a delicate declaration has to be carefully reviewed to make sure it is properly used and does not create problems like lossy Java -> Kotlin type parsing. Carefully read documentation and message of any declaration marked as DelicateKotlinPoetApi.
Indicates that a given API is experimental and subject to change.
A generated function declaration.
Represents the name of a member (such as a function or a property).
Assigns Kotlin identifier names to avoid collisions, keywords, and invalid characters. To use, first create an instance and allocate all of the names that you need. Typically this is a mix of user-supplied names and constants:
A type that can have originating elements.
A generated parameter declaration.
A generated property declaration.
A generated typealias declaration
A generated class, interface, or enum declaration.
Functions
Returns the class name for element.
Returns a parameterized type equivalent to type.
Returns a TypeName equivalent to this TypeMirror.
Returns a TypeName equivalent to the given Kotlin KType using reflection, maybe using kotlin-reflect if required.
Returns type variable equivalent to element.
Returns type variable equivalent to mirror.
Builds new CodeBlock by populating newly created CodeBlock.Builder using provided builderAction and then converting it to CodeBlock.
Returns the tag attached with T as a key, or null if no tag is attached with that key.
Attaches tag to the request using T as a key. Tags can be read from a request using Taggable.tag. Use null to remove any existing tag assigned for T.
Calls CodeBlock.Builder.indent then executes the provided builderAction on the CodeBlock.Builder and then executes CodeBlock.Builder.unindent before returning the original CodeBlock.Builder.