I think I managed to put most of the question in the title on this!
I am returning an object from Java to my own C ++ code:
jobject valueObject = env->CallObjectMethod(hashMapObject, hashMapGetMID, keyObject);
It is possible for me to verify that the returned object is one of the native types using something like:
jclass boolClass = env->FindClass("java/lang/Boolean");
if(env->IsInstanceOf(valueObject, boolClass) == JNI_TRUE) { }
So now I have a jobject, which, as I know, is logical (note the upper case B). The question is what is the most efficient way (given that I already have a job in my native code) to convert this to bool. Typing doesn't work, which makes sense.
Although the above example is logical, I also want to convert Character → char, Short-> short, Integer-> int, Float-> float, Double-> double.
(After I implemented it, I will post the answer to this question, which makes Boolean.booleanValue ())
source
share