public class ProviderBundle extends Object
ProviderBundle
:
public class MyPresenterBundle extends ProviderBundle { public final static int ID_Object1 = 0; public final static int ID_Object2 = 1; public final static int BUNDLE_SIZE = 2; @Inject MyPresenterBundle( final Providerobject1Provider, final Provider object2Provider) { super( BUNDLE_SIZE ); providers[ID_Object1] = object1Provider; providers[ID_Object2] = object2Provider; } }
Constructor and Description |
---|
ProviderBundle(int bundleSize)
Constructs a
ProviderBundle containing a given number of providers. |
protected final Provider<?>[] providers
public ProviderBundle(int bundleSize)
ProviderBundle
containing a given number of providers.
After calling this constructor you should set the provider manually like
so:
providers[0] = object1Provider; providers[1] = object2Provider; ... providers[bundleSize-1] = objectNProvider;
bundleSize
- The number of providers in the bundle.public Provider<?> get(int providerId)
providerId
- The id of the provider to access.Copyright © 2010–2014 Arcbees. All rights reserved.