public static class Advice.DynamicValue.ForFixedValue extends Object implements Advice.DynamicValue<Annotation>
A Advice.DynamicValue
implementation that always binds a fixed value.
The mapped value must be a constant value that can be embedded into a Java class file. This holds for all primitive types,
instances of String
and for Class
instances as well as their unloaded TypeDescription
representations.
Advice.DynamicValue.ForFixedValue
Constructor and Description |
---|
ForFixedValue(Object value)
Creates a dynamic value for a fixed value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object) |
int |
hashCode() |
Object |
resolve(MethodDescription.InDefinedShape instrumentedMethod,
ParameterDescription.InDefinedShape target,
AnnotationDescription.Loadable<Annotation> annotation,
boolean initialized)
Resolves a constant value that is mapped to a parameter that is annotated with a custom bound annotation.
|
String |
toString() |
public ForFixedValue(Object value)
value
- The fixed value to bind to the corresponding annotation.public Object resolve(MethodDescription.InDefinedShape instrumentedMethod, ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<Annotation> annotation, boolean initialized)
Advice.DynamicValue
resolve
in interface Advice.DynamicValue<Annotation>
instrumentedMethod
- The instrumented method onto which this advice is applied.target
- The target parameter that is bound.annotation
- The annotation that triggered this binding.initialized
- true
if the method is initialized when the value is bound, i.e. that the value is not
supplied to a constructor before the super constructor was invoked.null
to assign this value.Copyright © 2014–2016. All rights reserved.