I have one function (in a library I can't change the code) which takes a key and returns a Object. This code is written in java. I am calling this function from cpp code. I am accepting the result as jobject.
Added key as "key1" & value as boolean true by calling a function. it saves in a map after converting in into java BooleanObject.
When I get it back I get it back as Object. I want to compare it with true now. How can I do that?
I thought this question was how to handle a Java Object (that happens to be a Boolean) in cpp code?
If it's a Java question then you need to cast the Object to Boolean (maybe checking first that it is an instanceof Boolean). Java will handle conversion between a Boolean object and a boolean primitive (eg true) automatically - it's called unboxing