Module
Code IndexAdd Codota to your IDE (free)

Best code snippets using dagger.Module(Showing top 15 results out of 315)

origin: square/dagger

@Module
static class ModuleWithBinding {
 @Provides String provideString() {
  return "injected";
 }
}
origin: square/dagger

public TestingModuleAdapter(Class<M> moduleClass, Module annotation) {
 super(
   moduleClass,
   injectableTypesToKeys(annotation.injects()),
   annotation.staticInjections(),
   annotation.overrides(),
   annotation.includes(),
   annotation.complete(),
   annotation.library());
}
origin: square/dagger

@Module
static class ModuleWithConstructor {
 private final String value;
 ModuleWithConstructor(String value) {
  this.value = value;
 }
 @Provides String provideString() {
  return value;
 }
}
origin: square/dagger

@Module(
  injects = CoffeeApp.class,
  includes = PumpModule.class
)
class DripCoffeeModule {
 @Provides @Singleton Heater provideHeater() {
  return new ElectricHeater();
 }
}

origin: square/dagger

@Module(library = true)
static class DuplicateModule {
 @Provides @Singleton String provideFoo() { return "foo"; }
 @Provides @Singleton String provideBar() { return "bar"; }
}
origin: square/dagger

@Module(complete = false, library = true)
class PumpModule {
 @Provides Pump providePump(Thermosiphon pump) {
  return pump;
 }
}

origin: square/dagger

@Module(addsTo = RootModule.class, injects = Main.class )
static class ExtensionModule {
 @Provides(type=SET) @Singleton Integer provideC() { return counter.getAndIncrement(); }
 @Provides(type=SET) @Singleton Integer provideD() { return counter.getAndIncrement(); }
}
origin: square/dagger

@Module(injects = RealSingleton.class)
static class RootModule {
 @Provides(type=SET) @Singleton Integer provideA() { return counter.getAndIncrement(); }
 @Provides(type=SET) @Singleton Integer provideB() { return counter.getAndIncrement(); }
}
origin: square/dagger

@Module(
  injects = A.class, // for testing
  complete = false
)
static class RootModule {
 final A a;
 RootModule(A a) {
  this.a = a;
 }
 @Provides A provideA() { return a; }
}
origin: square/dagger

@Module(includes = ExtensionModule.class, overrides = true)
static class TestModule {
 @Provides(type=SET) @Singleton Integer provide9999() { return 9999; }
}
origin: square/dagger

@Module(injects = Entry$Point.class)
static class TestModule {
 @Provides String aString() { return "a"; }
}
origin: square/dagger

@Module(injects = TestEntryPoint.class)
static class ModuleWithEntryPoint {
}
origin: square/dagger

@Module
static class EmptyModule {
}
origin: square/dagger

@Module(includes = ModuleWithBinding.class)
static class ModuleWithChildModule {
}
origin: square/dagger

@Module(staticInjections = TestStaticInjection.class)
static class ModuleWithStaticInjection {
}
daggerModule

Most used methods

  • <init>
  • complete
  • includes
  • overrides
  • staticInjections
  • entryPoints
  • injects
  • library

Popular classes and methods

  • getOriginalFilename (MultipartFile)
  • setRequestProperty (URLConnection)
    Sets the value of the specified request header field. The value will only be used by the current URL
  • getApplicationContext (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Window (java.awt)
  • Path (java.nio.file)
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)