ClassInspectorUtil

object ClassInspectorUtil

Functions

codeLiteralOf
Link copied to clipboard
fun codeLiteralOf(literal: Any): CodeBlock
computeIsJvmField
Link copied to clipboard

Infers if property is a jvm field and should be annotated as such given the input parameters.

fun computeIsJvmField(property: ImmutableKmProperty, classInspector: ClassInspector, isCompanionObject: Boolean, hasGetter: Boolean, hasSetter: Boolean, hasField: Boolean): Boolean
createAnnotations
Link copied to clipboard
fun createAnnotations(siteTarget: AnnotationSpec.UseSiteTarget?, body: MutableCollection<AnnotationSpec>.() -> Unit): Collection<AnnotationSpec>
createClassName
Link copied to clipboard

Best guesses a ClassName as represented in Metadata's kotlinx.metadata.ClassName, where package names in this name are separated by '/' and class names are separated by '.'.

For example: "org/foo/bar/Baz.Nested".

Local classes are prefixed with ".", but for KotlinPoetMetadataSpecs' use case we don't deal with those.

fun createClassName(kotlinMetadataName: String): ClassName
createThrowsSpec
Link copied to clipboard
fun createThrowsSpec(exceptions: Collection<TypeName>, useSiteTarget: AnnotationSpec.UseSiteTarget?): AnnotationSpec
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
filterOutNullabilityAnnotations
Link copied to clipboard
fun filterOutNullabilityAnnotations(annotations: List<AnnotationSpec>): List<AnnotationSpec>
hashCode
Link copied to clipboard
open override fun hashCode(): Int
toString
Link copied to clipboard
open override fun toString(): String
toTreeSet
Link copied to clipboard
fun Iterable<AnnotationSpec>.toTreeSet(): TreeSet<AnnotationSpec>

Properties

JVM_NAME
Link copied to clipboard
val JVM_NAME: ClassName
KOTLIN_INTRINSIC_INTERFACES
Link copied to clipboard
val KOTLIN_INTRINSIC_INTERFACES: Set<ClassName>