Last active
March 27, 2019 20:42
-
-
Save ismailgungor/e6365b1022432a4cdc4260b9584617d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun lookIntoUnknownClass(sample: Any) { | |
val sampleClass = sample.javaClass | |
Log.d("Ref_Name", sampleClass.name) | |
Log.d("Ref_SimpleName", sampleClass.simpleName) | |
Log.d("Ref_IsArray", "${sampleClass.isArray}") | |
Log.d("Ref_IsInterface", "${sampleClass.isInterface}") | |
Log.d("Ref_Constructors_Count", "${sampleClass.constructors.size}") | |
Log.d("Ref_Constructors_Param_Count", "${sampleClass.constructors[0] | |
.parameterCount}") | |
for (declaredField in sampleClass.declaredFields) | |
Log.d("Ref_DeclaredField_Name", declaredField.name) | |
for (declaredMethod in sampleClass.declaredMethods) | |
Log.d("Ref_Declared_Method_Name", declaredMethod.name) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment