Android – JSON Object changes randomly from api

I get data from an api in which the json object changes randomly, like if it is “position”: 1, now it will change randomly to “number”: 1, so how can i check in my app if the object is “position”: 1, or “number”: 1, and use it as int?

Thanks in advance :)

Android – JSON Object changes randomly from api