javapoet-dsl / com.mostlycertain.javapoetdsl / com.squareup.javapoet.TypeName

Extensions for com.squareup.javapoet.TypeName

ensureBoxed

If the type is primitive (e.g. int, char), return the boxed type (e.g. Integer, Character). Otherwise, return this.

fun TypeName.ensureBoxed(): TypeName

ensureUnboxed

If the type is a boxed primitive (e.g. Integer, Character), return the primitive type (e.g. int, char). Otherwise, return this.

fun TypeName.ensureUnboxed(): TypeName

isNotPrimitive

val TypeName.isNotPrimitive: Boolean