From 83b330c0da9d6b820cfabbfea344bccda4c79a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Zuzelski?= Date: Wed, 28 Jun 2023 04:25:33 -0700 Subject: [PATCH] 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)); ``` PiperOrigin-RevId: 544017353 --- core/src/com/google/inject/Module.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/com/google/inject/Module.java b/core/src/com/google/inject/Module.java index 52cdd30689..ac9d7c68ae 100644 --- a/core/src/com/google/inject/Module.java +++ b/core/src/com/google/inject/Module.java @@ -28,6 +28,7 @@ * all methods annotated with {@literal @}{@link Provides}. Use scope and binding annotations on * these methods to configure the bindings. */ +@FunctionalInterface public interface Module { /**