I am printing value of scala Map in Java class like below
Option<Object> data = JSON.parseFull((String)zkClient.readData(statePath));
scala.collection.immutable.Map<String, Object> leaderInfo = scala.collection.immutable.Map<String, Object>) data.get();
System.out.println(leaderInfo.toString();
But I am surprised that sometimes the value comes as floating point number
controller_epoch -> 6.0, leader -> 1.0, version -> 1.0, leader_epoch -> 4.0, isr -> List(1.0)
and sometimes as Integer.
controller_epoch -> 6, leader -> 1, version -> 1, leader_epoch -> 4, isr -> List(1)
I want the data to be always parsed as Integer. Is there any way to do that?