@HashCodeAndEqualsPlugin.Enhance public static class Transformer.ForMethod extends java.lang.Object implements Transformer<MethodDescription>
MethodDescription.Token
.Modifier and Type | Class and Description |
---|---|
protected static class |
Transformer.ForMethod.MethodModifierTransformer
A transformer for a method's modifiers.
|
protected static class |
Transformer.ForMethod.TransformedMethod
The transformed method.
|
Transformer.Compound<S>, Transformer.ForField, Transformer.ForMethod, Transformer.NoOp
Modifier and Type | Field and Description |
---|---|
private Transformer<MethodDescription.Token> |
transformer
The transformer to be applied.
|
Constructor and Description |
---|
ForMethod(Transformer<MethodDescription.Token> transformer)
Creates a new transforming method transformer.
|
Modifier and Type | Method and Description |
---|---|
MethodDescription |
transform(TypeDescription instrumentedType,
MethodDescription methodDescription)
Transforms the supplied target.
|
static Transformer<MethodDescription> |
withModifiers(java.util.List<? extends ModifierContributor.ForMethod> modifierContributors)
Creates a transformer that enforces the supplied modifier contributors.
|
static Transformer<MethodDescription> |
withModifiers(ModifierContributor.ForMethod... modifierContributor)
Creates a transformer that enforces the supplied modifier contributors.
|
private final Transformer<MethodDescription.Token> transformer
public ForMethod(Transformer<MethodDescription.Token> transformer)
transformer
- The transformer to be applied.public static Transformer<MethodDescription> withModifiers(ModifierContributor.ForMethod... modifierContributor)
modifierContributor
- The modifier transformers in their application order.public static Transformer<MethodDescription> withModifiers(java.util.List<? extends ModifierContributor.ForMethod> modifierContributors)
modifierContributors
- The modifier contributors in their application order.public MethodDescription transform(TypeDescription instrumentedType, MethodDescription methodDescription)
transform
in interface Transformer<MethodDescription>
instrumentedType
- The instrumented type that declares the target being transformed.methodDescription
- The target entity that is being transformed.