public Key<Map<K, V>> getKey() { return (Key<Map<K, V>>) Key.get(mapOf(keyClass, valueClass)); }
private static <K, V> void exportMaps(Set<MapMapping<K, V>> mapMappings, MBeanExporter exporter, Injector injector, ObjectNameGenerator objectNameGenerator) { for (MapMapping<K, V> mapping : mapMappings) { BiFunction<ObjectNameGenerator, Entry<K, V>, ObjectName> namingFunction = mapping.getObjectNameFunction(); Map<K, V> map = injector.getInstance(mapping.getKey()); for (Map.Entry<K, V> entry : map.entrySet()) { ObjectName name = namingFunction.apply(objectNameGenerator, entry); exporter.export(name, entry.getValue()); } } }
public void as(BiFunction<ObjectNameGenerator, Entry<K, V>, ObjectName> nameFactory) { binder.addBinding().toInstance(new MapMapping<>(keyClass, valueClass, nameFactory)); } }
private static <K, V> void exportMaps(Set<MapMapping<K, V>> mapMappings, MBeanExporter exporter, Injector injector, ObjectNameGenerator objectNameGenerator) { for (MapMapping<K, V> mapping : mapMappings) { BiFunction<ObjectNameGenerator, Entry<K, V>, ObjectName> namingFunction = mapping.getObjectNameFunction(); Map<K, V> map = injector.getInstance(mapping.getKey()); for (Map.Entry<K, V> entry : map.entrySet()) { ObjectName name = namingFunction.apply(objectNameGenerator, entry); exporter.export(name, entry.getValue()); } } }
public void as(BiFunction<ObjectNameGenerator, Entry<K, V>, ObjectName> nameFactory) { binder.addBinding().toInstance(new MapMapping<>(keyClass, valueClass, nameFactory)); } }
public Key<Map<K, V>> getKey() { return (Key<Map<K, V>>) Key.get(mapOf(keyClass, valueClass)); }