本文整理了Java中brooklyn.util.collections.MutableMap.add()
方法的一些代码示例,展示了MutableMap.add()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MutableMap.add()
方法的具体详情如下:
包路径:brooklyn.util.collections.MutableMap
类名称:MutableMap
方法名:add
[英]as #put(Object,Object) but fluent style
[中]作为#put(Object,Object)但是流畅的风格
代码示例来源:origin: io.brooklyn/brooklyn-utils-common
/** as {@link #put(Object, Object)} but excluding null values, and fluent style */
public MutableMap<K,V> addIfNotNull(K key, V value) {
if (value!=null) add(key, value);
return this;
}
代码示例来源:origin: io.brooklyn/brooklyn-core
public Location resolveLocationDefinition(LocationDefinition ld, Map locationFlags, String optionalName) {
MutableMap newLocationFlags = new MutableMap().add(locationFlags).add(ld.getConfig());
if (optionalName==null && ld.getName()!=null) optionalName = ld.getName();
if (optionalName!=null) newLocationFlags.add("named", optionalName);
try {
return resolve(ld.getSpec(), newLocationFlags);
} catch (Exception e) {
throw new IllegalStateException("Cannot instantiate named location '"+optionalName+"' pointing at "+ld.getSpec()+": "+e, e);
}
}
代码示例来源:origin: io.brooklyn/brooklyn-core
@SuppressWarnings({ "unchecked", "rawtypes" })
public Task<T> build() {
MutableMap<String, Object> flags = MutableMap.of();
if (name!=null) flags.add("displayName", name);
if (!tags.isEmpty()) flags.add("tags", tags);
代码示例来源:origin: io.brooklyn/brooklyn-rest-server
MutableMap<String, Object> metadata = MutableMap.<String,Object>of("name", stream.streamType);
if (stream.streamSize.get()!=null) {
metadata.add("size", stream.streamSize.get());
metadata.add("sizeText", Strings.makeSizeString(stream.streamSize.get()));
内容来源于网络,如有侵权,请联系作者删除!