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