com.neko233.config233.utils.FieldUtilsForConfig233.kt Maven / Gradle / Ivy
package com.neko233.config233.utils
import java.lang.reflect.Field
object FieldUtilsForConfig233 {
@JvmStatic
fun getAllFields(obj: Any): List {
val fields = mutableListOf()
var currentClass: Class<*>? = obj.javaClass
while (currentClass != null) {
fields.addAll(currentClass.declaredFields)
currentClass = currentClass.superclass
}
return fields
}
}