2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.sal.restconf.impl.test.structures;
12 public class Lst extends YangElement {
13 private Set<LstItem> lstItems;
15 public Lst(String name) {
17 lstItems = new HashSet<>();
20 public Lst addLstItem(LstItem lstItem) {
21 lstItem.setLstName(name);
22 while (this.lstItems.contains(lstItem)) {
23 lstItem.incNumOfEqualItems();
25 this.lstItems.add(lstItem);
29 public Set<LstItem> getLstItems() {
34 public boolean equals(Object obj) {
38 if (!this.getClass().equals(obj.getClass())) {
41 if (!super.equals(obj)) {
45 if (this.lstItems == null) {
46 if (lst.lstItems != null) {
49 } else if (!this.lstItems.equals(lst.lstItems)) {
56 public int hashCode() {
58 int result = super.hashCode();
59 result = prime * result + ((lstItems == null) ? 0 : lstItems.hashCode());