Package org.robolectric.util.inject
Class Injector.Builder
java.lang.Object
org.robolectric.util.inject.Injector.Builder
- Enclosing class:
- Injector
Builder for
Injector
.-
Constructor Summary
ConstructorDescriptionBuilder()
Creates a new builder.Builder
(ClassLoader classLoader) Creates a new builder using the specified ClassLoader for plugin loading.Creates a new builder with a parent injector.Builder
(Injector superInjector, ClassLoader classLoader) Creates a new builder with a parent injector and the specified ClassLoader for plugin loading. -
Method Summary
Modifier and TypeMethodDescription<T> Injector.Builder
Registers an implementing class for the given dependency type.<T> Injector.Builder
Registers an instance for the given dependency type.<T> Injector.Builder
bind
(Injector.Key<T> key, T instance) Registers an instance for the given key.<T> Injector.Builder
bindDefault
(Class<T> type, Class<? extends T> defaultImplementingClass) Registers a fallback implementing class for the given dependency type.build()
Builds an injector as previously configured.
-
Constructor Details
-
Builder
public Builder()Creates a new builder. -
Builder
Creates a new builder using the specified ClassLoader for plugin loading. -
Builder
Creates a new builder with a parent injector. -
Builder
Creates a new builder with a parent injector and the specified ClassLoader for plugin loading.
-
-
Method Details
-
bind
Registers an instance for the given dependency type. -
bind
Registers an instance for the given key. -
bind
public <T> Injector.Builder bind(@Nonnull Class<T> type, @Nonnull Class<? extends T> implementingClass) Registers an implementing class for the given dependency type. -
bindDefault
public <T> Injector.Builder bindDefault(@Nonnull Class<T> type, @Nonnull Class<? extends T> defaultImplementingClass) Registers a fallback implementing class for the given dependency type. -
build
Builds an injector as previously configured.
-