/* * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.controller.sal.binding.impl.util; import com.google.common.collect.Multimap; import java.util.Collection; import java.util.HashSet; import java.util.Map.Entry; import org.opendaylight.yangtools.concepts.Path; @SuppressWarnings("all") public class MapUtils { public static

, V extends Object> Collection> getAllChildren(final Multimap map, final P path) { HashSet> _hashSet = new HashSet>(); final HashSet> ret = _hashSet; final Collection> entries = map.entries(); for (final Entry entry : entries) { { final P currentPath = entry.getKey(); if (path.contains(currentPath)) { ret.add(entry); } else if (currentPath.contains(path)){ ret.add(entry); } } } return ret; } }