From 5748883e16437b3612e8fe92a8819064ed3acd2c Mon Sep 17 00:00:00 2001
From: Tavian Barnes
- * ListBinder* *listBinder = ListBinder.build(binder(), String.class) + * ListBinder<String> listBinder = ListBinder.build(binder(), String.class) * .withDefaultPriority(); * listBinder.addBinding().toInstance("a"); * listBinder.addBinding().toInstance("b"); *
- * This will create a binding for a {@code List
To add an annotation to the list binding, simply write this:
* *- * ListBinder* *listBinder = ListBinder.build(binder(), String.class) + * ListBinder<String> listBinder = ListBinder.build(binder(), String.class) * .annotatedWith(Names.named("name")) * .withDefaultPriority(); *
- * and the created binding will be {@code @Named("name") List
@@ -84,13 +84,13 @@ import com.tavianator.sangria.core.UniqueAnnotations; * *
* // In some module - * ListBinderlistBinder1 = ListBinder.build(binder(), String.class) + * ListBinder<String> listBinder1 = ListBinder.build(binder(), String.class) * .withPriority(0); * listBinder1.addBinding().toInstance("a"); * listBinder1.addBinding().toInstance("b"); * * // ... some other module - * ListBinder listBinder2 = ListBinder.build(binder(), String.class) + * ListBinder<String> listBinder2 = ListBinder.build(binder(), String.class) * .withPriority(1); * listBinder2.addBinding().toInstance("c"); * listBinder2.addBinding().toInstance("d"); @@ -266,7 +266,7 @@ public class ListBinder { } /** - * Provider implementation for {@code List >}. + * Provider implementation for {@code List<Provider<T>>}. */ private static class ListOfProvidersProvider implements Provider >> { private final Key
>> setKey; @@ -355,7 +355,7 @@ public class ListBinder { } /** - * Provider implementation for {@code List }, in terms of {@code List >}. + * Provider implementation for {@code List<T>}, in terms of {@code List<Provider<T>>}. */ private static class ListOfProvidersAdapter implements Provider > { private final Key
>> providerListKey; -- cgit v1.2.3