Annotation Type Bind
-
@Retention(RUNTIME) @Target(FIELD) public @interface Bind
Annotation used byBoundFieldModuleto indicate that a field should be bound to its value using Guice.supports binding annotations. For example, to bind a
@Fast Car, use@Bind @Fast Car.Binding to
nullis only allowed for fields that are annotated@Nullable. See https://github.com/google/guice/wiki/UseNullable- See Also:
BoundFieldModule
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanlazyIf true,BoundFieldModulewill delay reading the field until injection time rather than eagerly reading it at configure time.Class<?>toIf specified,BoundFieldModulewill bind the annotated field's value to this type, rather than to the field's actual type.
-
-
-
Element Detail
-
to
Class<?> to
If specified,BoundFieldModulewill bind the annotated field's value to this type, rather than to the field's actual type.- Default:
- com.google.inject.testing.fieldbinder.Bind.class
-
-
-
lazy
boolean lazy
If true,BoundFieldModulewill delay reading the field until injection time rather than eagerly reading it at configure time.When used with Provider valued fields, the provider will be read from the field and
.get()will be called for each provision. This may be useful for testing provision failures.- Default:
- false
-
-