Skip to content

Instantly share code, notes, and snippets.

@yusufiga
Created January 13, 2017 08:21
Show Gist options
  • Save yusufiga/b7f2283ec1199734487601e164acf5ee to your computer and use it in GitHub Desktop.
Save yusufiga/b7f2283ec1199734487601e164acf5ee to your computer and use it in GitHub Desktop.
bind\((.+?).class\).toProvider\((.)(.+?).class\).in\(com.google.inject.Singleton.class\);
@Singleton\n@Binds\npublic abstract $1 bind$1($2$3 \L$2\E$3);
bind\(new TypeLiteral<(.+?)<(.+?)>>\(\) \{\n \}\).to\((.)(.+?).class\).in\(com.google.inject.Singleton.class\);
@Singleton\n@Binds\npublic abstract $1<$2> bind$1$2($3$4 \L$3\E$4);\n
@Bind for bind(IYourInterface.clas).to(YourImplementation.class) in abstract method
@Provide @Singleton for bind(IYourInterface.clas).toInstance(new YourImplementation())
@Singleton for bind(YourCalass.class).in(Singleton.class)
Lombok is not fully compilable with Dagger2 and data binding combination
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment