Yang and XML conversion to Json test with equals
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / structures / LfLst.java
1 package org.opendaylight.controller.sal.restconf.impl.test.structures;
2
3 import java.util.*;
4
5 public class LfLst extends YangElement {
6     Set<Lf> lfs;
7
8     public LfLst(String name) {
9         super(name);
10         lfs = new HashSet<>();
11     }
12
13     public LfLst addLf(Lf lf) {
14         lfs.add(lf);
15         return this;
16     }
17
18     public Set<Lf> getLfs() {
19         return lfs;
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         LfLst lfLst = (LfLst) obj;
34         if (!this.lfs.equals(lfLst.lfs)) {
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 + ((lfs == null) ? 0 : lfs.hashCode());
45         return result;
46     }
47
48     @Override
49     public String toString() {
50
51         return super.toString();
52     }
53
54 }