1 package org.opendaylight.controller.sal.restconf.impl.test.structures;
3 import java.util.HashMap;
9 Map<String, LfLst> lfLsts;
10 Map<String, Lst> lsts;
11 Map<String, Cont> conts;
12 private int numOfEqualItems = 0;
15 lfs = new HashMap<>();
16 conts = new HashMap<>();
17 lfLsts = new HashMap<>();
18 lsts = new HashMap<>();
21 public Map<String, Lst> getLsts() {
25 public Map<String, Cont> getConts() {
29 public Map<String, LfLst> getLfLsts() {
33 public Map<String, Lf> getLfs() {
37 public String getLstName() {
41 public LstItem addLf(Lf lf) {
42 lfs.put(lf.getName(), lf);
46 public LstItem addLf(String name, Object value) {
47 lfs.put(name, new Lf(name, value));
51 public void addLfLst(LfLst lfLst) {
52 lfLsts.put(lfLst.getName(), lfLst);
55 public void addLst(Lst lst) {
56 lsts.put(lst.getName(), lst);
59 public void addCont(Cont cont) {
60 conts.put(cont.getName(), cont);
63 public void incNumOfEqualItems() {
64 this.numOfEqualItems++;
68 public boolean equals(Object obj) {
72 if (!this.getClass().equals(obj.getClass())) {
75 LstItem lstItem = (LstItem) obj;
76 if (this.conts == null) {
77 if (lstItem.conts != null) {
80 } else if (!this.conts.equals(lstItem.conts)) {
83 if (this.lfs == null) {
84 if (lstItem.lfs != null) {
87 } else if (!this.lfs.equals(lstItem.lfs)) {
90 if (this.lfLsts == null) {
91 if (lstItem.lfLsts != null) {
94 } else if (!this.lfLsts.equals(lstItem.lfLsts)) {
97 if (this.lsts == null) {
98 if (lstItem.lsts != null) {
101 } else if (!this.lsts.equals(lstItem.lsts)) {
104 if (this.numOfEqualItems != lstItem.numOfEqualItems) {
111 public int hashCode() {
112 final int prime = 31;
114 result = prime * result + ((lfs == null) ? 0 : lfs.hashCode());
115 result = prime * result + ((lfLsts == null) ? 0 : lfLsts.hashCode());
116 result = prime * result + ((lsts == null) ? 0 : lsts.hashCode());
117 result = prime * result + ((conts == null) ? 0 : conts.hashCode());
118 result = prime * result + numOfEqualItems;
123 public String toString() {
124 return "lst item of " + lstName;
127 public void setLstName(String name) {