U - The bound annotation's type.@HashCodeAndEqualsPlugin.Enhance public static class TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue.OfConstant<U extends java.lang.annotation.Annotation> extends TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<U>
A parameter binder that binds a fixed value to a parameter annotation when using a MethodDelegation.
This binder is only capable to store
values that can either be expressed as Java byte code or as a constant pool value. This includes primitive types, String values,
Class values which can also be expressed as TypeDescription instances or method handles and method types for classes of
a version at least of Java 7. The latter instances can also be expressed as unloaded JavaConstant representations.
TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue.OfConstant<U extends java.lang.annotation.Annotation>TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding<S extends java.lang.annotation.Annotation>, TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<S extends java.lang.annotation.Annotation>| Modifier and Type | Field and Description |
|---|---|
private java.lang.Class<U> |
type
The type of the annotation that is bound by this binder.
|
private java.lang.Object |
value
The value that is assigned to any annotated parameter.
|
DEFAULTS| Modifier | Constructor and Description |
|---|---|
protected |
OfConstant(java.lang.Class<U> type,
java.lang.Object value)
Creates a binder for binding a fixed value to a parameter annotated with the given annotation.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
bind(AnnotationDescription.Loadable<U> annotation,
MethodDescription source,
ParameterDescription target)
Resolves a value for the given annotation on a parameter that is processed by a
MethodDelegation. |
java.lang.Class<U> |
getHandledType()
The annotation type that is handled by this parameter binder.
|
static <V extends java.lang.annotation.Annotation> |
of(java.lang.Class<V> type,
java.lang.Object value)
Creates a binder for binding a fixed value to a given annotation.
|
bindprivate final java.lang.Class<U extends java.lang.annotation.Annotation> type
@HashCodeAndEqualsPlugin.ValueHandling(value=REVERSE_NULLABILITY) private final java.lang.Object value
protected OfConstant(java.lang.Class<U> type, java.lang.Object value)
type - The type of the annotation that is bound by this binder.value - The value that is assigned to any annotated parameter.public static <V extends java.lang.annotation.Annotation> TargetMethodAnnotationDrivenBinder.ParameterBinder<V> of(java.lang.Class<V> type, java.lang.Object value)
V - The bound annotation's type.type - The type of the annotation that is bound by this binder.value - The value that is assigned to any annotated parameter.public java.lang.Class<U> getHandledType()
Annotation.annotationType() handled by this parameter binder.protected java.lang.Object bind(AnnotationDescription.Loadable<U> annotation, MethodDescription source, ParameterDescription target)
TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValueMethodDelegation.bind in class TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<U extends java.lang.annotation.Annotation>annotation - The annotation that triggered this binding.source - The method for which a delegation is currently bound.target - The parameter for which a value is bound.null for binding this value.