brooklyn.util.collections.MutableMap.put()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中brooklyn.util.collections.MutableMap.put()方法的一些代码示例,展示了MutableMap.put()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MutableMap.put()方法的具体详情如下:
包路径:brooklyn.util.collections.MutableMap
类名称:MutableMap
方法名:put

MutableMap.put介绍

暂无

代码示例

代码示例来源:origin: io.brooklyn/brooklyn-utils-common

/** as {@link #put(Object, Object)} but fluent style */
public MutableMap<K,V> add(K key, V value) {
  put(key, value);
  return this;
}

代码示例来源:origin: io.brooklyn/brooklyn-utils-common

public Builder<K, V> put(K key, V value) {
  result.put(key, value);
  return this;
}

代码示例来源:origin: io.brooklyn/brooklyn-utils-common

public Builder<K, V> putIfNotNull(K key, V value) {
  if (value!=null) result.put(key, value);
  return this;
}

代码示例来源:origin: io.brooklyn/brooklyn-utils-common

public static <K,V> MutableMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3,K k4, V v4,K k5, V v5,K k6,V v6,K k7,V v7) {
  MutableMap<K,V> result = new MutableMap<K,V>();
  result.put(k1, v1);
  result.put(k2, v2);
  result.put(k3, v3);
  result.put(k4, v4);
  result.put(k5, v5);
  result.put(k6, v6);
  result.put(k7, v7);
  return result;
 }

代码示例来源:origin: io.brooklyn/brooklyn-utils-common

public static <K,V> MutableMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3,K k4, V v4,K k5, V v5,K k6,V v6) {
  MutableMap<K,V> result = new MutableMap<K,V>();
  result.put(k1, v1);
  result.put(k2, v2);
  result.put(k3, v3);
  result.put(k4, v4);
  result.put(k5, v5);
  result.put(k6, v6);
  return result;
}

代码示例来源:origin: io.brooklyn/brooklyn-utils-common

public static <K,V> MutableMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3,K k4, V v4,K k5, V v5) {
  MutableMap<K,V> result = new MutableMap<K,V>();
  result.put(k1, v1);
  result.put(k2, v2);
  result.put(k3, v3);
  result.put(k4, v4);
  result.put(k5, v5);
  return result;
}

代码示例来源:origin: io.brooklyn/brooklyn-utils-common

public static <K,V> MutableMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3,K k4, V v4) {
  MutableMap<K,V> result = new MutableMap<K,V>();
  result.put(k1, v1);
  result.put(k2, v2);
  result.put(k3, v3);
  result.put(k4, v4);
  return result;
}

代码示例来源:origin: io.brooklyn/brooklyn-utils-common

public static <K,V> MutableMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3) {
  MutableMap<K,V> result = new MutableMap<K,V>();
  result.put(k1, v1);
  result.put(k2, v2);
  result.put(k3, v3);
  return result;
}

代码示例来源:origin: io.brooklyn/brooklyn-utils-common

public static <K,V> MutableMap<K,V> of(K k1, V v1, K k2, V v2) {
  MutableMap<K,V> result = new MutableMap<K,V>();
  result.put(k1, v1);
  result.put(k2, v2);
  return result;
}

代码示例来源:origin: io.brooklyn/brooklyn-utils-common

public Builder<K, V> put(Entry<? extends K, ? extends V> entry) {
  result.put(entry.getKey(), entry.getValue());
  return this;
}

代码示例来源:origin: io.brooklyn/brooklyn-utils-common

public static <K,V> MutableMap<K,V> of(K k1, V v1) {
  MutableMap<K,V> result = new MutableMap<K,V>();
  result.put(k1, v1);
  return result;
}

代码示例来源:origin: io.brooklyn/brooklyn-utils-common

public Builder<K, V> putIfAbsent(K key, V value) {
  if (!result.containsKey(key)) result.put(key, value);
  return this;
}

代码示例来源:origin: io.brooklyn/brooklyn-utils-common

/** moves the value stored under oldKey to newKey, if there was such a value */
public Builder<K, V> renameKey(K oldKey, K newKey) {
  if (result.containsKey(oldKey)) {
    V oldValue = result.remove(oldKey);
    result.put(newKey, oldValue);
  }
  return this;
}

代码示例来源:origin: io.brooklyn/brooklyn-rest-server

public static LinkWithMetadata asLink(Task<?> t) {
  if (t==null) return null;
  MutableMap<String,Object> data = new MutableMap<String,Object>();
  data.put("id", t.getId());
  if (t.getDisplayName()!=null) data.put("taskName", t.getDisplayName());
  Entity entity = BrooklynTasks.getContextEntity(t);
  if (entity!=null) {
    data.put("entityId", entity.getId());
    if (entity.getDisplayName()!=null) data.put("entityDisplayName", entity.getDisplayName());
  }
  return new LinkWithMetadata("/v1/activities/"+t.getId(), data);
}

代码示例来源:origin: io.brooklyn/brooklyn-core

flags.put("name", namePart);
  flags.put("localTempDir", new File(brooklynDataDir));

代码示例来源:origin: io.brooklyn/brooklyn-core

MutableMap<String, Object> flags = MutableMap.<String, Object>builder().putAll(filteredProperties).putAll(locationFlags).build();
flags.put("machines", machines);
if (user != null) flags.put("user", user);
if (name != null) flags.put("name", name);
if (registry != null) {
  String brooklynDataDir = (String) registry.getProperties().get(BrooklynConfigKeys.BROOKLYN_DATA_DIR.getName());
  if (brooklynDataDir != null && brooklynDataDir.length() > 0) {
    flags.put("localTempDir", new File(brooklynDataDir));

相关文章