java.util.LinkedHashMap.replace()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(219)

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

LinkedHashMap.replace介绍

暂无

代码示例

代码示例来源:origin: Graylog2/graylog2-server

@Override
protected LinkedHashMap<String, Callable<? extends ChannelHandler>> getCustomChildChannelHandlers(MessageInput input) {
  final LinkedHashMap<String, Callable<? extends ChannelHandler>> finalChannelHandlers = new LinkedHashMap<>(super.getCustomChildChannelHandlers(input));
  // Replace the "framer" channel handler inserted by the parent.
  finalChannelHandlers.replace("framer", () -> new SyslogTCPFramingRouterHandler(maxFrameLength, delimiter));
  return finalChannelHandlers;
}

代码示例来源:origin: Graylog2/graylog2-server

@Override
protected LinkedHashMap<String, Callable<? extends ChannelHandler>> getChannelHandlers(MessageInput input) {
  final LinkedHashMap<String, Callable<? extends ChannelHandler>> handlers = new LinkedHashMap<>(super.getChannelHandlers(input));
  // Replace the default "codec-aggregator" handler with one that passes the remote address
  final RemoteAddressCodecAggregator aggregator = (RemoteAddressCodecAggregator) getAggregator();
  handlers.replace("codec-aggregator", () -> new NetflowMessageAggregationHandler(aggregator, localRegistry));
  handlers.remove("udp-datagram");
  return handlers;
}

代码示例来源:origin: com.ca.apim.gateway/gateway-export-plugin

@Override
public synchronized boolean replace(Object key, Object oldValue, Object newValue) {
  return propertyMap.replace(key, oldValue, newValue);
}

代码示例来源:origin: com.ca.apim.gateway/gateway-export-plugin

@Override
public synchronized Object replace(Object key, Object value) {
  return propertyMap.replace(key, value);
}

代码示例来源:origin: Ekryd/sortpom

public ChildElementSorter(DependencySortOrder dependencySortOrder, List<Element> children) {
  Collection<String> childElementNames = dependencySortOrder.getChildElementNames();
  childElementNames.forEach(name ->
      childElementTextMappedBySortedNames.put(name.toUpperCase(), ""));
  children.forEach(element ->
      childElementTextMappedBySortedNames.replace(element.getName().toUpperCase(), element.getText()));
}

相关文章