f5b3a5446e8f504c29f05989d9992cb2c7c448d1
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / structures / Lst.java
1 package org.opendaylight.controller.sal.restconf.impl.test.structures;
2
3 import java.util.*;
4
5 public class Lst extends YangElement {
6     private Set<LstItem> lstItems;
7
8     public Lst(String name) {
9         super(name);
10         lstItems = new HashSet<>();
11     }
12
13     public void addLstItem(LstItem lstItem) {
14         lstItem.setLstName(name);
15         this.lstItems.add(lstItem);
16     }
17
18     public Set<LstItem> getLstItems() {
19         return lstItems;
20     }
21
22     @Override
23     public boolean equals(Object obj) {
24         if (this == obj) {
25             return true;
26         }
27         if (!this.getClass().equals(obj.getClass())) {
28             return false;
29         }
30         if (!super.equals(obj)) {
31             return false;
32         }
33         Lst lst = (Lst) obj;
34         if (!this.lstItems.equals(lst.lstItems)) {
35             return false;
36         }
37         return true;
38     }
39
40     @Override
41     public int hashCode() {
42         final int prime = 31;
43         int result = super.hashCode();
44         result = prime * result + ((lstItems == null) ? 0 : lstItems.hashCode());
45         return result;
46     }
47
48 }