Package org.apache.cayenne.di
Interface BindingBuilder<T>
- Type Parameters:
- T- An interface type of the service being bound.
public interface BindingBuilder<T>
A binding builder that helps with fluent binding creation.
- Since:
- 3.1
- 
Method SummaryModifier and TypeMethodDescriptionvoidSets the scope of a bound instance.voidSets the scope of a bound instance to singleton.toInstance(T instance) toProvider(Class<? extends Provider<? extends T>> providerType) toProviderInstance(Provider<? extends T> provider) voidSets the scope of a bound instance to "no scope".
- 
Method Details- 
to- Throws:
- DIRuntimeException
 
- 
toInstance- Throws:
- DIRuntimeException
 
- 
toProviderBindingBuilder<T> toProvider(Class<? extends Provider<? extends T>> providerType) throws DIRuntimeException - Throws:
- DIRuntimeException
 
- 
toProviderInstance- Throws:
- DIRuntimeException
 
- 
inSets the scope of a bound instance. This method is used to change the default scope which is usually a singleton to a custom scope.
- 
inSingletonScopevoid inSingletonScope()Sets the scope of a bound instance to singleton. Singleton is normally the default, so calling this method explicitly is rarely needed.
- 
withoutScopevoid withoutScope()Sets the scope of a bound instance to "no scope". This means that a new instance of an object will be created on every call toInjector.getInstance(Class).
 
-