本文整理了Java中java.util.Hashtable.forEach()
方法的一些代码示例,展示了Hashtable.forEach()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hashtable.forEach()
方法的具体详情如下:
包路径:java.util.Hashtable
类名称:Hashtable
方法名:forEach
暂无
代码示例来源:origin: org.apache.ant/ant
/**
* Sets the parameters for the transformer.
*/
private void setTransformationParameters() {
params.forEach((key, value) -> transformer.setParameter(key, value));
}
代码示例来源:origin: org.apache.ant/ant
allProps.forEach((k, v) -> props.put(String.valueOf(k), String.valueOf(v)));
代码示例来源:origin: org.apache.ant/ant
saxParser.parse(new InputSource(in), handler);
handler.getFiles().forEach(ejbFiles::put);
} catch (Exception e) {
throw new BuildException(
代码示例来源:origin: wildfly/wildfly
env.forEach((key, value) -> log.debugf(" Property [%s] with value [%s]", key,
key != InitialDirContext.SECURITY_CREDENTIALS ? Arrays2.objectToString(value) : "******"));
代码示例来源:origin: wildfly/wildfly
dirContext.getEnvironment().forEach(props::put);
props.put(LdapContext.PROVIDER_URL, namingProviderURL);
props.put(LdapContext.SECURITY_PRINCIPAL, distinguishedName);
代码示例来源:origin: org.apache.ant/ant-junit
/**
* Set the properties to be used in the test.
* @param p the properties.
* This is a copy of the projects ant properties.
*/
public void setProperties(Hashtable<?, ?> p) {
props = new Properties();
p.forEach(props::put);
}
代码示例来源:origin: stackoverflow.com
public final class ShorterFoo
{
public static void main(final String... args)
{
System.getProperties()
.forEach((key, value) -> System.out.println(key + ": " + value));
}
}
代码示例来源:origin: stackoverflow.com
Properties vmProps = System.getProperties();
vmProps.forEach((t,u) -> System.out.println("Property: " + t + "\nValue: " + u + "\n"));
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
@Override
public synchronized void forEach(BiConsumer<? super K,? super V> action) {
getDelegate().forEach(action);
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
@Override
public synchronized void forEach(BiConsumer<? super K,? super V> action) {
getDelegate().forEach(action);
}
代码示例来源:origin: reactiverse/vertx-maven-plugin
/**
*
*/
private synchronized void syncMonitor() {
observers.forEach((path, observer)
-> this.monitor.getObservers().forEach(observer2 -> {
Path path1 = Paths.get(observer2.getDirectory().toString());
if (!observers.containsKey(path1)) {
this.monitor.removeObserver(observer2);
}
}));
}
代码示例来源:origin: shawntime/shawn-common-utils
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
try {
Hashtable<String, Object> uri = getURI(request);
uri.forEach(MDC::put);
filterChain.doFilter(request, response);
} finally {
clearMDC();
}
}
代码示例来源:origin: org.apache.ant/ant-netrexx
/** Copy eligible files from the srcDir to destDir */
private void copyFilesToDestination() {
if (!filecopyList.isEmpty()) {
log("Copying " + filecopyList.size() + " file"
+ (filecopyList.size() == 1 ? "" : "s")
+ " to " + destDir.getAbsolutePath());
filecopyList.forEach((fromFile, toFile) -> {
try {
FileUtils.getFileUtils().copyFile(fromFile, toFile);
} catch (IOException ioe) {
throw new BuildException("Failed to copy " + fromFile
+ " to " + toFile + " due to " + ioe.getMessage(), ioe);
}
});
}
}
代码示例来源:origin: OpenNMS/opennms
private void addStringAttributesToCollectionSet(JMXDataSource ds, AbstractJmxSample sample,
Resource resource, ObjectName objectName) {
final String groupName = fixGroupName(JmxUtils.getGroupName(stringMap, sample.getMbean()));
final String domain = objectName.getDomain();
final Hashtable<String, String> properties = objectName.getKeyPropertyList();
properties.forEach(
(key, value) -> collectionSetBuilder.withStringAttribute(resource, groupName, key, value));
if (domain != null) {
collectionSetBuilder.withStringAttribute(resource, groupName, "domain", objectName.getDomain());
}
}
代码示例来源:origin: org.opennms.features.collection/org.opennms.features.collection.collectors
private void addStringAttributesToCollectionSet(JMXDataSource ds, AbstractJmxSample sample,
Resource resource, ObjectName objectName) {
final String groupName = fixGroupName(JmxUtils.getGroupName(stringMap, sample.getMbean()));
final String domain = objectName.getDomain();
final Hashtable<String, String> properties = objectName.getKeyPropertyList();
properties.forEach(
(key, value) -> collectionSetBuilder.withStringAttribute(resource, groupName, key, value));
if (domain != null) {
collectionSetBuilder.withStringAttribute(resource, groupName, "domain", objectName.getDomain());
}
}
代码示例来源:origin: org.wildfly.security/wildfly-elytron
env.forEach((key, value) -> log.debugf(" Property [%s] with value [%s]", key,
key != InitialDirContext.SECURITY_CREDENTIALS ? Arrays2.objectToString(value) : "******"));
代码示例来源:origin: octo-online/reactive-audit
@Test(expected = ReactiveAuditException.class)
public void forEach()
{
ReactiveAudit.off.commit();
Hashtable hash=new Hashtable();
TestTools.strict.commit();
hash.forEach(null);
}
@Test(expected = ReactiveAuditException.class)
代码示例来源:origin: org.jboss.eap/wildfly-client-all
dirContext.getEnvironment().forEach(props::put);
props.put(LdapContext.PROVIDER_URL, namingProviderURL);
props.put(LdapContext.SECURITY_PRINCIPAL, distinguishedName);
代码示例来源:origin: org.wildfly.security/wildfly-elytron
dirContext.getEnvironment().forEach(props::put);
props.put(LdapContext.PROVIDER_URL, namingProviderURL);
props.put(LdapContext.SECURITY_PRINCIPAL, distinguishedName);
代码示例来源:origin: org.wildfly.security/wildfly-elytron-realm-ldap
dirContext.getEnvironment().forEach(props::put);
props.put(LdapContext.PROVIDER_URL, namingProviderURL);
props.put(LdapContext.SECURITY_PRINCIPAL, distinguishedName);
内容来源于网络,如有侵权,请联系作者删除!