Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate Module explicitly as @FunctionalInterface. #1754

Closed
wants to merge 1 commit into from

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Jun 28, 2023

Annotate Module explicitly as @FunctionalInterface.

Module is implicitly a @FunctionalInterface already. That is very convenient, as it allows to express

methodThatTakesAModule(
    new AbstractModule(){
      @Override
      protected void configure() {
        bind(Foo.class).annotatedWith(Bar.class).toInstance(barredFoo);
      }
    }
);

as

methodThatTakesAModule(binder -> binder.bind(Foo.class).annotatedWith(Bar.class).toInstance(barredFoo));

@copybara-service copybara-service bot force-pushed the test_544017353 branch 3 times, most recently from 83b330c to 5be3c2c Compare June 28, 2023 14:35
@sameb sameb closed this Jun 28, 2023
@sameb sameb reopened this Jun 28, 2023
@sameb
Copy link
Member

sameb commented Jun 28, 2023

(sorry didn't mean to close this manually)

`Module` is implicitly a `@FunctionalInterface` already. That is very convenient, as it allows to express

```
methodThatTakesAModule(
    new AbstractModule(){
      @OverRide
      protected void configure() {
        bind(Foo.class).annotatedWith(Bar.class).toInstance(barredFoo);
      }
    }
);
```

as

```
methodThatTakesAModule(binder -> binder.bind(Foo.class).annotatedWith(Bar.class).toInstance(barredFoo));
```

PiperOrigin-RevId: 544017353
@copybara-service copybara-service bot force-pushed the test_544017353 branch 2 times, most recently from e92a3ea to ee93362 Compare June 28, 2023 15:02
@copybara-service copybara-service bot closed this Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants