All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.didiglobal.booster.transform.asm.AnnotationNode.kt Maven / Gradle / Ivy

There is a newer version: 5.1.0
Show newest version
package com.didiglobal.booster.transform.asm

import org.objectweb.asm.tree.AnnotationNode

@Suppress("UNCHECKED_CAST")
fun  AnnotationNode.getValue(name: String = "value"): T? = values?.withIndex()?.iterator()?.let {
    while (it.hasNext()) {
        val i = it.next()
        if (i.index % 2 == 0 && i.value == name) {
            return@let it.next().value as T
        }
    }
    null
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy