// Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
//     static ObjectNameGenerator defaultObjectNameGenerator()
//     {
//         return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
//                 .withProperties(properties)
//                 .build();
//     }
// 
//     default String generatedNameOf(Class<?> type)
//     {
//         return generatedNameOf(type, ImmutableMap.of("name", type.getSimpleName()));
//     }
// 
//     default String generatedNameOf(Class<?> type, String name)
//     {
//         return generatedNameOf(type, ImmutableMap.<String, String>builder()
//                 .put("type", type.getSimpleName())
//                 .put("name", name)
//                 .build());
//     }
// 
//     String generatedNameOf(Class<?> type, Map<String, String> properties);
// }


import com.google.inject.multibindings.Multibinder;
import org.weakref.jmx.ObjectNameGenerator;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import java.util.Map.Entry;
import java.util.function.BiFunction;
package org.weakref.jmx.guice;




public class MapExportBinder<K, V>
{
    protected final Multibinder<MapMapping<?, ?>> binder;
    protected final Class<K> keyClass;
    private final Class<V> valueClass;

    MapExportBinder(Multibinder<MapMapping<?, ?>> binder, Class<K> keyClass, Class<V> valueClass)
    {
        this.binder = binder;
        this.keyClass = keyClass;
        this.valueClass = valueClass;
    }

    public void withGeneratedName(NamingFunction<V> valueNamingFunction)
    {
// Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
//     static ObjectNameGenerator defaultObjectNameGenerator()
//     {
//         return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
//                 .withProperties(properties)
//                 .build();
//     }
// 
//     default String generatedNameOf(Class<?> type)
//     {
//         return generatedNameOf(type, ImmutableMap.of("name", type.getSimpleName()));
//     }
// 
//     default String generatedNameOf(Class<?> type, String name)
//     {
//         return generatedNameOf(type, ImmutableMap.<String, String>builder()
//                 .put("type", type.getSimpleName())
//                 .put("name", name)
//                 .build());
//     }
// 
//     String generatedNameOf(Class<?> type, Map<String, String> properties);
// }


// Path: src/main/java/org/weakref/jmx/guice/MapExportBinder.java
import com.google.inject.multibindings.Multibinder;
import org.weakref.jmx.ObjectNameGenerator;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import java.util.Map.Entry;
import java.util.function.BiFunction;

package org.weakref.jmx.guice;




public class MapExportBinder<K, V>
{
    protected final Multibinder<MapMapping<?, ?>> binder;
    protected final Class<K> keyClass;
    private final Class<V> valueClass;

    MapExportBinder(Multibinder<MapMapping<?, ?>> binder, Class<K> keyClass, Class<V> valueClass)
    {
        this.binder = binder;
        this.keyClass = keyClass;
        this.valueClass = valueClass;
    }

    public void withGeneratedName(NamingFunction<V> valueNamingFunction)
    {
        BiFunction<ObjectNameGenerator, Entry<K, V>, ObjectName> nameFactory = (factory, entry) -> {