Hello i have a new problem today i need to construct an object like that with this particular strucural (i have made changes):
{
principalid:
{
id:1
{
price1:20,
price2:30,
price3:30
secondaryid:
{
subId:1
{
price1:60,
price2:80,
price3:120
thirdid:
{
subsubId:1
{
price1:60,
price2:80,
price3:120
}
subsubId:2 {
price1:60,
price2:80,
price3:120
}
}}}}
I have my java object named Price with getter and setter
public class Price {
private Double price1 = null;
private Double price2 = null;
private Double price3 = null;
}
To create the first level, i used to declare a new attribute in my Object something like :
private final Map<String, Price> mapPrice = new HashMap<>();
Where String represents Id but i want use same for subid and subsubId
How can i do to organise my object with multiple sub level ?
Do you have any suggestion or any sample to implement this solutions ?
Thanks