本文整理了Java中org.jvnet.hk2.component.MultiMap.entrySet()
方法的一些代码示例,展示了MultiMap.entrySet()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MultiMap.entrySet()
方法的具体详情如下:
包路径:org.jvnet.hk2.component.MultiMap
类名称:MultiMap
方法名:entrySet
[英]Lists up all entries.
[中]列出所有条目。
代码示例来源:origin: com.sun.enterprise/auto-depends
MultiMapIterator(MultiMap map) {
itr = map.entrySet().iterator();
}
代码示例来源:origin: org.glassfish.hk2/auto-depends
MultiMapIterator(MultiMap map) {
itr = map.entrySet().iterator();
}
代码示例来源:origin: com.sun.enterprise/auto-depends
private Map<String, Set<String>> getMatchingMap(MultiMap<String, String> props) {
Map<String, Set<String>> result = new HashMap<String, Set<String>>();
for (Entry<String, List<String>> entry : props.entrySet()) {
String key = entry.getKey().toLowerCase();
Set<String> set = result.get(key);
if (null == set) {
set = new HashSet<String>();
result.put(entry.getKey().toLowerCase(), set);
}
set.addAll(entry.getValue());
}
return result;
}
代码示例来源:origin: org.glassfish.hk2/auto-depends
private Map<String, Set<String>> getMatchingMap(MultiMap<String, String> props) {
Map<String, Set<String>> result = new HashMap<String, Set<String>>();
for (Entry<String, List<String>> entry : props.entrySet()) {
String key = entry.getKey().toLowerCase();
Set<String> set = result.get(key);
if (null == set) {
set = new HashSet<String>();
result.put(entry.getKey().toLowerCase(), set);
}
set.addAll(entry.getValue());
}
return result;
}
代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all
/**
* @return the map as "key=value1,key=value2,...."
*/
public String toCommaSeparatedString() {
StringBuilder buf = new StringBuilder();
for (Map.Entry<K, List<V>> e : entrySet()) {
for (V v : e.getValue()) {
if (buf.length() > 0) {
buf.append(',');
}
buf.append(e.getKey()).append('=').append(v);
}
}
return buf.toString();
}
代码示例来源:origin: org.glassfish.hk2/auto-depends
private void includeBinding(LinkedHashSet<Binding<?>> result, MultiMap<String,?> mm) {
for (Entry<String, ?> entry : mm.entrySet()) {
includeBindingIfMatches(result, null, (List<?>)entry.getValue());
}
}
代码示例来源:origin: org.glassfish.hk2/auto-depends
/**
* @return the map as "key=value1,key=value2,...."
*/
public String toCommaSeparatedString() {
StringBuilder buf = new StringBuilder();
for (Entry<K, List<V>> e : entrySet()) {
for (V v : e.getValue()) {
if (buf.length() > 0) {
buf.append(',');
}
buf.append(e.getKey()).append('=').append(v);
}
}
return buf.toString();
}
代码示例来源:origin: hstaudacher/osgi-jax-rs-connector
/**
* @return the map as "key=value1,key=value2,...."
*/
public String toCommaSeparatedString() {
StringBuilder buf = new StringBuilder();
for (Map.Entry<K, List<V>> e : entrySet()) {
for (V v : e.getValue()) {
if (buf.length() > 0) {
buf.append(',');
}
buf.append(e.getKey()).append('=').append(v);
}
}
return buf.toString();
}
代码示例来源:origin: javaee/hk2
/**
* @return the map as "key=value1,key=value2,...."
*/
public String toCommaSeparatedString() {
StringBuilder buf = new StringBuilder();
for (Map.Entry<K, List<V>> e : entrySet()) {
for (V v : e.getValue()) {
if (buf.length() > 0) {
buf.append(',');
}
buf.append(e.getKey()).append('=').append(v);
}
}
return buf.toString();
}
代码示例来源:origin: com.sun.enterprise/auto-depends
/**
* @return the map as "key=value1,key=value2,...."
*/
public String toCommaSeparatedString() {
StringBuilder buf = new StringBuilder();
for (Entry<K, List<V>> e : entrySet()) {
for (V v : e.getValue()) {
if (buf.length() > 0) {
buf.append(',');
}
buf.append(e.getKey()).append('=').append(v);
}
}
return buf.toString();
}
代码示例来源:origin: hstaudacher/osgi-jax-rs-connector
/**
* @return the map as "key=value1,key=value2,...."
*/
public String toCommaSeparatedString() {
StringBuilder buf = new StringBuilder();
for (Map.Entry<K, List<V>> e : entrySet()) {
for (V v : e.getValue()) {
if (buf.length() > 0) {
buf.append(',');
}
buf.append(e.getKey()).append('=').append(v);
}
}
return buf.toString();
}
代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all
/**
* Copy constructor.
*
* @param base map to copy
*/
public MultiMap(MultiMap<K, V> base) {
this();
for (Map.Entry<K, List<V>> e : base.entrySet()) {
List<V> value = newList(e.getValue());
if (!value.isEmpty()) {
store.put(e.getKey(), newList(e.getValue()));
}
}
}
代码示例来源:origin: hstaudacher/osgi-jax-rs-connector
/**
* Copy constructor.
*
* @param base map to copy
*/
public MultiMap(MultiMap<K, V> base) {
this();
for (Map.Entry<K, List<V>> e : base.entrySet()) {
List<V> value = newList(e.getValue());
if (!value.isEmpty()) {
store.put(e.getKey(), newList(e.getValue()));
}
}
}
代码示例来源:origin: hstaudacher/osgi-jax-rs-connector
/**
* Copy constructor.
*
* @param base map to copy
*/
public MultiMap(MultiMap<K, V> base) {
this();
for (Map.Entry<K, List<V>> e : base.entrySet()) {
List<V> value = newList(e.getValue());
if (!value.isEmpty()) {
store.put(e.getKey(), newList(e.getValue()));
}
}
}
代码示例来源:origin: javaee/hk2
/**
* Copy constructor.
*
* @param base map to copy
*/
public MultiMap(MultiMap<K, V> base) {
this();
for (Map.Entry<K, List<V>> e : base.entrySet()) {
List<V> value = newList(e.getValue());
if (!value.isEmpty()) {
store.put(e.getKey(), newList(e.getValue()));
}
}
}
代码示例来源:origin: com.sun.enterprise/auto-depends
/**
* Releases all the components. Should be called for orderly shut-down of
* the system.
* <p/>
* TODO: more javadoc needed
*/
public void release() {
// TODO: synchronization story?
for (Entry<String, List<Inhabitant>> e : byType.entrySet()) {
for (Inhabitant i : e.getValue()) {
i.release();
notify(i, EventType.INHABITANT_REMOVED, null, null);
}
}
}
代码示例来源:origin: org.glassfish.hk2/auto-depends
/**
* Releases all the components. Should be called for orderly shut-down of
* the system.
* <p/>
* TODO: more javadoc needed
*/
public void release() {
// TODO: synchronization story?
for (Entry<String, List<Inhabitant>> e : byType.entrySet()) {
for (Inhabitant i : e.getValue()) {
i.release();
notify(i, EventType.INHABITANT_REMOVED, null, null);
}
}
}
代码示例来源:origin: allegro/hermes
public void start() {
try {
oAuthHttpClient.start();
logRepositories.forEach(serviceLocatorLogRepositoryFunction ->
trackers.add(serviceLocatorLogRepositoryFunction.apply(serviceLocator)));
messageSenderProvidersSuppliers.entrySet().stream().forEach(entry ->
entry.getValue().stream().forEach(supplier ->
messageSenderFactory.addSupportedProtocol(entry.getKey(), supplier.apply(serviceLocator))
));
supervisorController.start();
assignmentCache.start();
maxRateSupervisor.start();
serviceLocator.getService(ConsumersRuntimeMonitor.class).start();
consumerHttpServer.start();
hooksHandler.startup(serviceLocator);
} catch (Exception e) {
logger.error("Exception while starting Hermes Consumers", e);
}
}
代码示例来源:origin: pl.allegro.tech.hermes/hermes-consumers
public void start() {
try {
oAuthHttpClient.start();
logRepositories.forEach(serviceLocatorLogRepositoryFunction ->
trackers.add(serviceLocatorLogRepositoryFunction.apply(serviceLocator)));
messageSenderProvidersSuppliers.entrySet().stream().forEach(entry ->
entry.getValue().stream().forEach(supplier ->
messageSenderFactory.addSupportedProtocol(entry.getKey(), supplier.apply(serviceLocator))
));
supervisorController.start();
assignmentCache.start();
maxRateSupervisor.start();
serviceLocator.getService(ConsumersRuntimeMonitor.class).start();
consumerHttpServer.start();
hooksHandler.startup(serviceLocator);
} catch (Exception e) {
logger.error("Exception while starting Hermes Consumers", e);
}
}
代码示例来源:origin: org.glassfish.hk2/auto-depends
@Override
public Collection<Binding<?>> getDeclaredBindings(Descriptor descriptor) {
LinkedHashSet<Binding<?>> result = new LinkedHashSet<Binding<?>>();
// try optimized approaches first
if (DescriptorImpl.isEmpty(descriptor)) {
includeBinding(result, byContract);
includeBinding(result, byType);
} else if (null != descriptor && !DescriptorImpl.isEmpty(descriptor.getTypeName())) {
includeBindingIfMatches(result, descriptor, byType.get(descriptor.getTypeName()));
// Note, that next we are treating the type as a Contract (seems appropriate to do)
includeBindingIfMatches(result, descriptor, byContract.get(descriptor.getTypeName()));
} else if (null != descriptor && !DescriptorImpl.isEmpty(descriptor.getContracts())) {
includeBindingIfMatches(result, descriptor, byContract.getIntersectionOfAll(descriptor.getContracts()));
} else {
// no optimized approaches, let's try them all
includeBindingIfMatches(result, descriptor, byType.entrySet());
includeBindingIfMatches(result, descriptor, byContract.entrySet());
}
return result;
}
内容来源于网络,如有侵权,请联系作者删除!