transform

fun transform(metadata: Metadata, transformer: (KotlinClassMetadata) -> Unit): Metadata

Utility method to combine reading and writing of metadata: First, metadata is parsed with readStrict; then, transformer is called on a read instance. transformer may mutate passed instance of KotlinClassMetadata to achieve a desired result. After transformation, KotlinClassMetadata.write method is called and its result becomes return value of this method.

See also

Throws

if metadata cannot be read or written