Bulk-add copyright headers to java files
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / structures / LfLst.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.sal.restconf.impl.test.structures;
9
10 import java.util.HashSet;
11 import java.util.Set;
12
13 public class LfLst extends YangElement {
14     Set<Lf> lfs;
15
16     public LfLst(String name) {
17         super(name);
18         lfs = new HashSet<>();
19     }
20
21     public LfLst addLf(Object value) {
22         return addLf(new Lf(value));
23     }
24
25     public LfLst addLf(Lf lf) {
26         while (this.lfs.contains(lf)) {
27             lf.incNumOfEqualItems();
28         }
29         this.lfs.add(lf);
30         return this;
31     }
32
33     public Set<Lf> getLfs() {
34         return lfs;
35     }
36
37     @Override
38     public boolean equals(Object obj) {
39         if (this == obj) {
40             return true;
41         }
42         if (!this.getClass().equals(obj.getClass())) {
43             return false;
44         }
45         if (!super.equals(obj)) {
46             return false;
47         }
48         LfLst lfLst = (LfLst) obj;
49         if (this.lfs == null) {
50             if (lfLst.lfs != null) {
51                 return false;
52             }
53         } else if (!this.lfs.equals(lfLst.lfs)) {
54             return false;
55         }
56         return true;
57     }
58
59     @Override
60     public int hashCode() {
61         final int prime = 31;
62         int result = super.hashCode();
63         result = prime * result + ((lfs == null) ? 0 : lfs.hashCode());
64         return result;
65     }
66
67     @Override
68     public String toString() {
69
70         return super.toString();
71     }
72
73 }