mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 17:07:15 +02:00
Migrate @Provides methods to @Binds methods where possible.
@Binds is a much more efficient way to delegate one binding to another in that: * The @Binds method does not need to be invoked * It does not generate an additional Provider implementation * An additional Provider does does not need to be instantiated Future changes to Dagger's component processor will add even further benefits. More information: [] ATTENTION REVIEWERS: This migration is being done with global approval. Per-project approval is not required. Tested: TAP train for global presubmit queue [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=125980758
This commit is contained in:
parent
a4091594d0
commit
a47cc2a85c
5 changed files with 20 additions and 26 deletions
|
@ -14,15 +14,13 @@
|
|||
|
||||
package google.registry.groups;
|
||||
|
||||
import dagger.Binds;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
/** Dagger module for groups package. */
|
||||
@Module
|
||||
public final class GroupsModule {
|
||||
public abstract class GroupsModule {
|
||||
|
||||
@Provides
|
||||
static GroupsConnection provideGroupsConnection(DirectoryGroupsConnection connection) {
|
||||
return connection;
|
||||
}
|
||||
@Binds
|
||||
abstract GroupsConnection provideGroupsConnection(DirectoryGroupsConnection connection);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue