lundi 8 juillet 2019

What is not an instanceof Class in java?

I'm trying to get a conditional to evaluate to false. I have a Field which is a Map that I've gotten from looking at declaredFields. What can the Map parameterized type type be that will cause the conditional to be false?

// field is a Map from a class using reflection (declaredFields)
Type type = ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[i]
if (type instanceof Class) {
    everthingsAClass()
} else {
    whatIsntAClass()
}





Aucun commentaire:

Enregistrer un commentaire