Basically i am trying to implement something like this, where partner node is of say "type1", client node is of "type2" and user nodes is of "type3". And each of the nodes can have multiple number of child nodes. So Partner1 can have any number of client nodes under it, similarly client nodes can have any number of users under it.
I have started the implementation but i am stuck now.The code which i have written is as follows.
public class ClientProperty {
public class Root{} //NodeType1
public class Partner{ //NodeType2
public String partner_id;
public String partner_name;
public int partner_node_id;
public Partner(String partner_id,String partner_name,int partner_node_id){
this.partner_id = partner_id;
this.partner_name = partner_name;
this.partner_node_id = partner_node_id;
}
}
public class Clients{ //NodeType3
public String client_name;
public String client_id;
public int client_node_id;
public Map<Enum,List<Enum>> clientproperty = new HashMap<Enum,List<Enum>>();
public Clients(String client_name, String client_id, int client_node_id,Map<Enum,List<Enum>> clientproperty){
this.client_name = client_name;
this.client_id = client_id;
this.client_node_id = client_node_id;
this.clientproperty = clientproperty;
}
}
public class Users{ //NodeType4
public String user_name;
public String user_id;
public int user_node_id;
public Users(String user_id,String user_name, int user_node_id){
this.user_id = user_id;
this.user_name = user_name;
this.user_node_id = user_node_id;
}
}
public class Node{
Node next;
Object nodes;
public Node(){
next = null;
}
public Node(Object nodes, Node next){
this.nodes = nodes;
this.next = next;
}
}
}
Let me know if some insights is required