Top Description Inners Methods
com.google.inject.multibindings

public @Interface ProvidesIntoOptional

extends Annotation
Annotations
@Documented
@Target:METHOD
@Retention:RUNTIME
@Keep
Static Imports
java.lang.annotation.ElementType.METHOD, .RetentionPolicy.RUNTIME

Annotates methods of a Module to add items to a Multibinder. The method's return type and binding annotation determines what Optional this will contribute to. For example,
@ProvidesIntoOptional(DEFAULT)
@Named("url")
String provideFooUrl(FooManager fm) { return fm.getUrl(); }

@ProvidesIntoOptional(ACTUAL)
@Named("url")
String provideBarUrl(BarManager bm) { return bm.getUrl(); }
will set the default value of @Named("url") Optional<String> to foo's URL, and then override it to bar's URL.
Author
[email protected] (Sam Berlin)
Since
4.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Method Summary

Modifier and TypeMethod and Description
public ProvidesIntoOptional.Type
value()

Specifies if the binding is for the actual or default value.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public ProvidesIntoOptional.Type value()

Specifies if the binding is for the actual or default value.

com.google.inject.multibindings back to summary

public final Enum ProvidesIntoOptional.Type

extends Enum<ProvidesIntoOptional.Type>
Class Inheritance

Since
4.0

Field Summary

Modifier and TypeField and Description
public static final ProvidesIntoOptional.Type
public static final ProvidesIntoOptional.Type

Constructor Summary

AccessConstructor and Description
private
Type()

Method Summary

Modifier and TypeMethod and Description
public static ProvidesIntoOptional.Type
public static ProvidesIntoOptional.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ACTUALback to summary
public static final ProvidesIntoOptional.Type ACTUAL

Corresponds to OptionalBinder#setBinding.

DEFAULTback to summary
public static final ProvidesIntoOptional.Type DEFAULT

Corresponds to OptionalBinder#setDefault.

Constructor Detail

Typeback to summary
private Type()

Method Detail

valueOfback to summary
public static ProvidesIntoOptional.Type valueOf(String name)
valuesback to summary
public static ProvidesIntoOptional.Type[] values()