Class BoundFieldModule.BoundFieldInfo
- java.lang.Object
-
- com.google.inject.testing.fieldbinder.BoundFieldModule.BoundFieldInfo
-
- Enclosing class:
- BoundFieldModule
public static final class BoundFieldModule.BoundFieldInfo extends Object
Information about a field bound byBoundFieldModule
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bind
getBindAnnotation()
The @Bind
annotation which is present on the field.com.google.inject.Key<?>
getBoundKey()
The key this field will bind to.Field
getField()
The field itself.com.google.inject.TypeLiteral<?>
getFieldType()
The actual type of the field.Object
getValue()
Returns the current value of this field.
-
-
-
Method Detail
-
getField
public Field getField()
The field itself.
-
getFieldType
public com.google.inject.TypeLiteral<?> getFieldType()
The actual type of the field.For example,
@Bind(to = Object.class) Number one = new Integer(1);
will beNumber
.@Bind Provider<Number>
will beProvider<Number>
.
-
getBindAnnotation
public Bind getBindAnnotation()
The @Bind
annotation which is present on the field.Note this is not the same as the binding annotation (or qualifier) for
getBoundKey()
-
getBoundKey
public com.google.inject.Key<?> getBoundKey()
The key this field will bind to.@Bind(to = Object.class) @MyQualifier Number one = new Integer(1);
will be@MyQualifier Object
.@Bind @MyQualifier(2) Number one = new Integer(1);
will be@MyQualifier(2) Number
.@Bind @MyQualifier Provider<String> three = "default"
will be@MyQualfier String
-
getValue
public Object getValue()
Returns the current value of this field.
-
-