U
- The bound annotation's type.@HashCodeAndEqualsPlugin.Enhance public static class TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue.OfConstant<U extends 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 Annotation>
TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding<S extends Annotation>, TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<S extends Annotation>
DEFAULTS
Modifier | Constructor and Description |
---|---|
protected |
OfConstant(Class<U> type,
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 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 . |
Class<U> |
getHandledType()
The annotation type that is handled by this parameter binder.
|
static <V extends Annotation> |
of(Class<V> type,
Object value)
Creates a binder for binding a fixed value to a given annotation.
|
bind
public static <V extends Annotation> TargetMethodAnnotationDrivenBinder.ParameterBinder<V> of(Class<V> type, 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 Class<U> getHandledType()
Annotation.annotationType()
handled by this parameter binder.protected Object bind(AnnotationDescription.Loadable<U> annotation, MethodDescription source, ParameterDescription target)
TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue
MethodDelegation
.bind
in class TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<U extends 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.Copyright © 2014–2020. All rights reserved.