Getting the class value of a class object

I have a parameter map that can contain strings as well as custom object types as values. How can I get the class name of the Map values ​​recording.

Right now if I do 
 paramMap.each {
    println(it.value.class.name) 
}

      

It gives me all the entries as java.util.LinkedHashMap$Entry

How can I get the actual type

value stored in the card eg String, Configuration, SecurityConfig ... etc.

Thank you in advance

+3


source to share


1 answer


This should work:



paramMap.each { key, value ->
    println( value.getClass().name )
}

      

+5


source







All Articles