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.binding.impl.util
10 import com.google.common.collect.Multimap
11 import java.util.Collection
12 import java.util.HashSet
13 import java.util.Map.Entry
14 import org.opendaylight.yangtools.concepts.Path
18 public static def <P extends Path<P>, V> Collection<Entry<? extends P, ? extends V>> getAllChildren(
19 Multimap<? extends P, ? extends V> map, P path) {
20 val ret = new HashSet();
21 val entries = map.entries;
23 for (entry : entries) {
24 val currentPath = entry.key;
25 // If the registered reader processes nested elements
26 if (path.contains(currentPath)) {
28 } else if(currentPath.contains(path)) {
29 // If the registered reader is parent of entry