java.util.Properties.computeIfAbsent()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(119)

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

Properties.computeIfAbsent介绍

暂无

代码示例

代码示例来源:origin: apache/hive

@Override
public synchronized Object computeIfAbsent(Object key, Function mappingFunction) {
 if (interned != null) copyFromInternedToThis();
 return super.computeIfAbsent(key, mappingFunction);
}

代码示例来源:origin: org.apache.hive/hive-common

@Override
public synchronized Object computeIfAbsent(Object key, Function mappingFunction) {
 if (interned != null) copyFromInternedToThis();
 return super.computeIfAbsent(key, mappingFunction);
}

代码示例来源:origin: commercetools/commercetools-jvm-sdk

private static String extract(final Properties properties, final String prefix, final String suffix) {
  final String mapKey = buildPropKey(prefix, suffix);
  return properties.computeIfAbsent(mapKey, key -> throwPropertiesException(prefix, mapKey)).toString();
}

代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-project-config

/**
 * Configure the Eclipse JDT task
 *
 * @param eclipseJdt Eclipse JDT task
 */
@Mutate
public void configureEclipseJdtTask(@Each GenerateEclipseJdt eclipseJdt) {
  Properties properties = loadProperties("org.eclipse.jdt.core.prefs");
  eclipseJdt.getJdt().getFile().withProperties(p -> {
    properties.forEach((name, value) -> {
      p.computeIfAbsent(name, n -> value);
    });
  });
}

代码示例来源:origin: me.seeber.gradle/gradle-project-config

/**
 * Configure the Eclipse JDT task
 *
 * @param eclipseJdt Eclipse JDT task
 */
@Mutate
public void configureEclipseJdtTask(@Each GenerateEclipseJdt eclipseJdt) {
  Properties properties = loadProperties("org.eclipse.jdt.core.prefs");
  eclipseJdt.getJdt().getFile().withProperties(p -> {
    properties.forEach((name, value) -> {
      p.computeIfAbsent(name, n -> value);
    });
  });
}

相关文章

微信公众号

最新文章

更多