本文整理汇总了Java中org.apache.commons.collections4.MultiValuedMap.entries方法的典型用法代码示例。如果您正苦于以下问题:Java MultiValuedMap.entries方法的具体用法?Java MultiValuedMap.entries怎么用?Java MultiValuedMap.entries使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.collections4.MultiValuedMap
的用法示例。
在下文中一共展示了MultiValuedMap.entries方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: putAll
import org.apache.commons.collections4.MultiValuedMap; //导入方法依赖的package包/类
@Override
public boolean putAll(final MultiValuedMap<? extends K, ? extends V> map) {
if (map == null) {
throw new NullPointerException("Map must not be null.");
}
boolean changed = false;
for (Map.Entry<? extends K, ? extends V> entry : map.entries()) {
changed |= put(entry.getKey(), entry.getValue());
}
return changed;
}
示例2: putAll
import org.apache.commons.collections4.MultiValuedMap; //导入方法依赖的package包/类
/**
* Copies all of the mappings from the specified MultiValuedMap to this map.
* The effect of this call is equivalent to that of calling
* {@link #put(Object,Object) put(k, v)} on this map once for each mapping
* from key {@code k} to value {@code v} in the specified map. The
* behavior of this operation is undefined if the specified map is modified
* while the operation is in progress.
*
* @param map mappings to be stored in this map, may not be null
* @return true if the map changed as a result of this operation
* @throws NullPointerException if map is null
*/
@Override
public boolean putAll(final MultiValuedMap<? extends K, ? extends V> map) {
if (map == null) {
throw new NullPointerException("Map must not be null.");
}
boolean changed = false;
for (Map.Entry<? extends K, ? extends V> entry : map.entries()) {
changed |= put(entry.getKey(), entry.getValue());
}
return changed;
}