2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
8 package org.opendaylight.controller.sal.core.impl;
\r
10 import java.util.ArrayList;
\r
11 import java.util.List;
\r
12 import java.util.Map;
\r
14 import org.opendaylight.controller.yang.common.QName;
\r
17 public class Utils {
\r
19 public static <T> void addToMap(Map<QName, List<T>> map, QName key, T value) {
\r
20 List<T> list = map.get(key);
\r
22 list = new ArrayList<T>();
\r
28 public static <T> void removeFromMap(Map<QName, List<T>> map, QName key,
\r
30 List<T> list = map.get(key);
\r
35 if (list.isEmpty()) {
\r