Tabnine Logo
InternalProviderImpl.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
toothpick.InternalProviderImpl
constructor

Best Java code snippets using toothpick.InternalProviderImpl.<init> (Showing top 18 results out of 315)

origin: stephanenicolas/toothpick

/**
 * Install bindings for scope.
 */
private void installBindingForScope() {
 //it's always possible to get access to the scope that contains an injected object.
 installBoundProvider(Scope.class, null, new InternalProviderImpl<>(this), false);
}
origin: stephanenicolas/toothpick

private <T> InternalProviderImpl<T> createInternalProvider(Scope scope, Class<?> factoryKeyClass,
  boolean isProviderClass,
  boolean isCreatingInstancesInScope,
  boolean isCreatingSingletonInScope,
  boolean isProvidingInstancesInScope) {
 if (isCreatingInstancesInScope) {
  return new ScopedProviderImpl<>(scope,
    factoryKeyClass,
    isProviderClass,
    isCreatingSingletonInScope,
    isProvidingInstancesInScope);
 } else {
  return new InternalProviderImpl<>(factoryKeyClass,
    isProviderClass,
    isCreatingSingletonInScope,
    isProvidingInstancesInScope);
 }
}
origin: stephanenicolas/toothpick

@Test(expected = IllegalArgumentException.class)
public void testCreateInternalProviderImpl_shouldFail_whenProviderInstanceIsNull() {
 //GIVEN
 //WHEN
 new InternalProviderImpl((Provider<String>) null, false);
 //THEN
 fail("Should throw an exception");
}
origin: stephanenicolas/toothpick

@Test(expected = IllegalArgumentException.class)
public void testCreateInternalProviderImpl_shouldFail_whenProviderFactoryClassIsNull() {
 //GIVEN
 //WHEN
 new InternalProviderImpl((Class) null, true, false, false);
 //THEN
 fail("Should throw an exception");
}
origin: stephanenicolas/toothpick

@Test(expected = IllegalArgumentException.class)
public void testCreateInternalProviderImpl_shouldFail_whenProviderFactoryIsNull() {
 //GIVEN
 //WHEN
 new InternalProviderImpl((Factory<Provider<String>>) null, true);
 //THEN
 fail("Should throw an exception");
}
origin: stephanenicolas/toothpick

@Test(expected = IllegalArgumentException.class)
public void testCreateInternalProviderImpl_shouldFail_whenFactoryIsNull() {
 //GIVEN
 //WHEN
 new InternalProviderImpl((Factory<String>) null, false);
 //THEN
 fail("Should throw an exception");
}
origin: stephanenicolas/toothpick

@Test(expected = IllegalArgumentException.class)
public void testCreateInternalProviderImpl_shouldFail_whenFactoryClassIsNull() {
 //GIVEN
 //WHEN
 new InternalProviderImpl((Class) null, false, false, false);
 //THEN
 fail("Should throw an exception");
}
origin: stephanenicolas/toothpick

@Test(expected = IllegalArgumentException.class)
public void testCreateInternalProviderImpl_shouldFail_whenInstanceIsNull() {
 //GIVEN
 //WHEN
 new InternalProviderImpl((String) null);
 //THEN
 fail("Should throw an exception");
}
origin: stephanenicolas/toothpick

} else {
 final InternalProviderImpl<T> newProvider = new InternalProviderImpl<>(factory,
   false);
origin: stephanenicolas/toothpick

   false);
case INSTANCE:
 return new InternalProviderImpl<>(binding.getInstance());
case PROVIDER_INSTANCE:
 return new InternalProviderImpl<>(binding.getProviderInstance(), binding.isProvidingSingletonInScope());
case PROVIDER_CLASS:
 return createInternalProvider(this,
origin: com.github.stephanenicolas.toothpick/toothpick-runtime

/**
 * Install bindings for scope.
 */
private void installBindingForScope() {
 //it's always possible to get access to the scope that contains an injected object.
 installBoundProvider(Scope.class, null, new InternalProviderImpl<>(this), false);
}
origin: com.github.stephanenicolas/toothpick-runtime

public ScopeImpl(Object name) {
 super(name);
 //it's always possible to get access to the scope that conitains an injected object.
 installBoundProvider(Scope.class, null, new InternalProviderImpl<>(this));
}
origin: com.github.stephanenicolas/toothpick-runtime

private <T> InternalProviderImpl<T> createInternalProvider(Scope scope, Class<?> factoryKeyClass, boolean isProviderClass, boolean isScoped) {
 if (isScoped) {
  return new ScopedProviderImpl<>(scope, factoryKeyClass, isProviderClass);
 } else {
  return new InternalProviderImpl<>(factoryKeyClass, isProviderClass);
 }
}
origin: com.github.stephanenicolas.toothpick/toothpick-runtime

private <T> InternalProviderImpl<T> createInternalProvider(Scope scope, Class<?> factoryKeyClass,
  boolean isProviderClass,
  boolean isCreatingInstancesInScope,
  boolean isCreatingSingletonInScope,
  boolean isProvidingInstancesInScope) {
 if (isCreatingInstancesInScope) {
  return new ScopedProviderImpl<>(scope,
    factoryKeyClass,
    isProviderClass,
    isCreatingSingletonInScope,
    isProvidingInstancesInScope);
 } else {
  return new InternalProviderImpl<>(factoryKeyClass,
    isProviderClass,
    isCreatingSingletonInScope,
    isProvidingInstancesInScope);
 }
}
origin: com.github.stephanenicolas/toothpick-runtime

/*VisibleForTesting*/ <T> InternalProviderImpl<T> toProvider(Binding<T> binding) {
 if (binding == null) {
  throw new IllegalStateException("null binding are not allowed. Should not happen unless getBindingSet is overridden.");
 }
 Configuration.instance.checkIllegalBinding(binding);
 switch (binding.getMode()) {
  case SIMPLE:
   return createInternalProvider(this, binding.getKey(), false, binding.isScoped());
  case CLASS:
   return createInternalProvider(this, binding.getImplementationClass(), false, binding.isScoped());
  case INSTANCE:
   return new InternalProviderImpl<>(binding.getInstance());
  case PROVIDER_INSTANCE:
   // to ensure providers do not have to deal with concurrency, we wrap them in a thread safe provider
   // We do not need to pass the scope here because the provider won't use any scope to create the instance
   return new InternalProviderImpl<>(binding.getProviderInstance());
  case PROVIDER_CLASS:
   return createInternalProvider(this, binding.getProviderClass(), true, binding.isScoped());
  //JACOCO:OFF
  default:
   throw new IllegalStateException(format("mode is not handled: %s. This should not happen.", binding.getMode()));
   //JACOCO:ON
 }
}
origin: com.github.stephanenicolas/toothpick-runtime

} else {
 final InternalProviderImpl<T> newProvider = new InternalProviderImpl<>(factory, false);
origin: com.github.stephanenicolas.toothpick/toothpick-runtime

} else {
 final InternalProviderImpl<T> newProvider = new InternalProviderImpl<>(factory,
   false);
origin: com.github.stephanenicolas.toothpick/toothpick-runtime

   false);
case INSTANCE:
 return new InternalProviderImpl<>(binding.getInstance());
case PROVIDER_INSTANCE:
 return new InternalProviderImpl<>(binding.getProviderInstance(), binding.isProvidingSingletonInScope());
case PROVIDER_CLASS:
 return createInternalProvider(this,
toothpickInternalProviderImpl<init>

Popular methods of InternalProviderImpl

  • get

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now