public final class

Guice4

extends Object
java.lang.Object
   ↳ org.eclipse.sisu.inject.Guice4

Class Overview

Utility methods for dealing with changes in the Guice 4.0 SPI.

Summary

Public Methods
static Object getDeclaringSource(Binding<?> binding)
Returns the source that originally declared the given binding.
static Provider<?> getProviderInstance(ProviderInstanceBinding<?> binding)
Returns the provider that originally backed the given binding.
static <T> Provider<T> lazy(Binding<T> binding)
Returns a lazy provider that only uses the binding once and caches the result.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static Object getDeclaringSource (Binding<?> binding)

Returns the source that originally declared the given binding.

Parameters
binding The binding
Returns
  • Declaring source; null if it doesn't exist

public static Provider<?> getProviderInstance (ProviderInstanceBinding<?> binding)

Returns the provider that originally backed the given binding.

Parameters
binding The binding
Returns
  • Provider instance

public static Provider<T> lazy (Binding<T> binding)

Returns a lazy provider that only uses the binding once and caches the result.

Parameters
binding The binding
Returns
  • Lazy caching provider