Here is my Allowance class
public class Allowance {
private String Id;
private String Name;
private String Type;
private String RemainingAmount;
private String TotalAmount;
}
This is created list
public List<Allowance> getBList(){
List<Allowance> BList = new ArrayList<>();
List.add(new Allowance("5964852","Name1","DATA","10","458965"));
List.add(new Allowance("651655","Name2","DATA","20","5481662"));
List.add(new Allowance("123","Name3","VOICE","30","8889625"));
List.add(new Allowance("123423","Name4","DATA","20","325489"));
return BList;
}
Here is my Benefits class
public class Benefits {
private String itemId;
private String bName;
private String remaining;
private String bTotal;
}
So, I want to set Allowance class variables values to Benefits class variables values Like this
Id value --> itemId value
Name value --> bName value
RemainingAmount value ---> remaining value
TotalAmount value ---> bTotal value
Then i want to return Benefits list like this
["itemId" : "5964852","bName": "Name1","remaining":"10","bTotal":"458965"]
Any one can help me ?
Allowance, creates aBenefit?