Class ImmutableClassToInstanceMap.Builder<B>

java.lang.Object
com.google.common.collect.ImmutableClassToInstanceMap.Builder<B>
Enclosing class:
ImmutableClassToInstanceMap<B>

public static final class ImmutableClassToInstanceMap.Builder<B> extends Object
A builder for creating immutable class-to-instance maps. Example:

 static final ImmutableClassToInstanceMap<Handler> HANDLERS =
     new ImmutableClassToInstanceMap.Builder<Handler>()
         .put(FooHandler.class, new FooHandler())
         .put(BarHandler.class, new SubBarHandler())
         .put(Handler.class, new QuuxHandler())
         .build();
 

After invoking build() it is still possible to add more entries and build again. Thus each map generated by this builder will be a superset of any map generated before it.

Since:
2.0
Author:
Kevin Bourrillion