kotlinpoet / com.squareup.kotlinpoet / PropertySpec

PropertySpec

class PropertySpec : Taggable, OriginatingElementsHolder

A generated property declaration.

Types

Builder

class Builder : Taggable.Builder<PropertySpec.Builder>, OriginatingElementsHolder.Builder<PropertySpec.Builder>

Properties

annotations

val annotations: List<AnnotationSpec>

delegated

val delegated: Boolean

getter

val getter: FunSpec?

initializer

val initializer: CodeBlock?

kdoc

val kdoc: CodeBlock

modifiers

val modifiers: Set<KModifier>

mutable

val mutable: Boolean

name

val name: String

receiverType

val receiverType: TypeName?

setter

val setter: FunSpec?

type

val type: TypeName

typeVariables

val typeVariables: List<TypeVariableName>

Functions

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

toBuilder

fun toBuilder(): PropertySpec.Builder

toString

fun toString(): String

Companion Object Functions

builder

fun builder(name: String, type: TypeName, vararg modifiers: KModifier): PropertySpec.Builder
fun builder(name: String, type: Type, vararg modifiers: KModifier): PropertySpec.Builder
fun builder(name: String, type: KClass<*>, vararg modifiers: KModifier): PropertySpec.Builder

Extension Functions

tag

fun <T : Any> Taggable.tag(): T?

Returns the tag attached with T as a key, or null if no tag is attached with that key.