Reputation: 759
Am new to java and have a query.Please suggest me a solution :
Am doing API level testing and need to pass the request body parameters of a service like below :
Upvotes: 0
Views: 1550
Reputation: 2030
I would suggest you create some kind of a class which will represent your map key/values so it will be easier to work with it for other developers.
Upvotes: 0
Reputation: 29
You can create a class which holds string and int values. In other words, HaspMap<String,Object>
.
Upvotes: 0
Reputation: 666
Convert your integer value in string and then pass it, as your method expect String parameter, you cannot directly pass integer
sell.requestAdd( "Amount",String.valueOf(Your_Integer_Value));
Upvotes: 2
Reputation: 2583
Java is strongly typed language, so your Map can't store Integer values, as String is defined as both key and value. If you want to store any object - changed map to Map<String, Object>
Upvotes: 0