Package com.google.inject.internal
Class ConstantBindingBuilderImpl<T>
- java.lang.Object
-
- com.google.inject.internal.AbstractBindingBuilder<T>
-
- com.google.inject.internal.ConstantBindingBuilderImpl<T>
-
- All Implemented Interfaces:
AnnotatedConstantBindingBuilder
,ConstantBindingBuilder
public final class ConstantBindingBuilderImpl<T> extends AbstractBindingBuilder<T> implements AnnotatedConstantBindingBuilder, ConstantBindingBuilder
Bind a constant.- Author:
- jessewilson@google.com (Jesse Wilson)
-
-
Field Summary
-
Fields inherited from class com.google.inject.internal.AbstractBindingBuilder
ANNOTATION_ALREADY_SPECIFIED, binder, BINDING_TO_NULL, CONSTANT_VALUE_ALREADY_SET, elements, IMPLEMENTATION_ALREADY_SET, NULL_KEY, position, SCOPE_ALREADY_SET, SINGLE_INSTANCE_AND_SCOPE
-
-
Constructor Summary
Constructors Constructor Description ConstantBindingBuilderImpl(Binder binder, List<Element> elements, Object source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConstantBindingBuilder
annotatedWith(Annotation annotation)
See the EDSL examples atBinder
.ConstantBindingBuilder
annotatedWith(Class<? extends Annotation> annotationType)
See the EDSL examples atBinder
.void
to(boolean value)
Binds constant to the given value.void
to(byte value)
Binds constant to the given value.void
to(char value)
Binds constant to the given value.void
to(double value)
Binds constant to the given value.void
to(float value)
Binds constant to the given value.void
to(int value)
Binds constant to the given value.void
to(long value)
Binds constant to the given value.void
to(short value)
Binds constant to the given value.<E extends Enum<E>>
voidto(E value)
Binds constant to the given value.void
to(Class<?> value)
Binds constant to the given value.void
to(String value)
Binds constant to the given value.String
toString()
-
Methods inherited from class com.google.inject.internal.AbstractBindingBuilder
annotatedWithInternal, annotatedWithInternal, asEagerSingleton, checkNotAnnotated, checkNotScoped, checkNotTargetted, getBinding, in, in, keyTypeIsSet, setBinding
-
-
-
-
Method Detail
-
annotatedWith
public ConstantBindingBuilder annotatedWith(Class<? extends Annotation> annotationType)
Description copied from interface:AnnotatedConstantBindingBuilder
See the EDSL examples atBinder
.- Specified by:
annotatedWith
in interfaceAnnotatedConstantBindingBuilder
-
annotatedWith
public ConstantBindingBuilder annotatedWith(Annotation annotation)
Description copied from interface:AnnotatedConstantBindingBuilder
See the EDSL examples atBinder
.- Specified by:
annotatedWith
in interfaceAnnotatedConstantBindingBuilder
-
to
public void to(String value)
Description copied from interface:ConstantBindingBuilder
Binds constant to the given value.- Specified by:
to
in interfaceConstantBindingBuilder
-
to
public void to(int value)
Description copied from interface:ConstantBindingBuilder
Binds constant to the given value.- Specified by:
to
in interfaceConstantBindingBuilder
-
to
public void to(long value)
Description copied from interface:ConstantBindingBuilder
Binds constant to the given value.- Specified by:
to
in interfaceConstantBindingBuilder
-
to
public void to(boolean value)
Description copied from interface:ConstantBindingBuilder
Binds constant to the given value.- Specified by:
to
in interfaceConstantBindingBuilder
-
to
public void to(double value)
Description copied from interface:ConstantBindingBuilder
Binds constant to the given value.- Specified by:
to
in interfaceConstantBindingBuilder
-
to
public void to(float value)
Description copied from interface:ConstantBindingBuilder
Binds constant to the given value.- Specified by:
to
in interfaceConstantBindingBuilder
-
to
public void to(short value)
Description copied from interface:ConstantBindingBuilder
Binds constant to the given value.- Specified by:
to
in interfaceConstantBindingBuilder
-
to
public void to(char value)
Description copied from interface:ConstantBindingBuilder
Binds constant to the given value.- Specified by:
to
in interfaceConstantBindingBuilder
-
to
public void to(byte value)
Description copied from interface:ConstantBindingBuilder
Binds constant to the given value.- Specified by:
to
in interfaceConstantBindingBuilder
-
to
public void to(Class<?> value)
Description copied from interface:ConstantBindingBuilder
Binds constant to the given value.- Specified by:
to
in interfaceConstantBindingBuilder
-
to
public <E extends Enum<E>> void to(E value)
Description copied from interface:ConstantBindingBuilder
Binds constant to the given value.- Specified by:
to
in interfaceConstantBindingBuilder
-
-