Class MethodNameTransformer.Suffixing
- java.lang.Object
-
- net.bytebuddy.dynamic.scaffold.inline.MethodNameTransformer.Suffixing
-
- All Implemented Interfaces:
MethodNameTransformer
- Enclosing interface:
- MethodNameTransformer
@Enhance public static class MethodNameTransformer.Suffixing extends Object implements MethodNameTransformer
A method name transformer that adds a fixed suffix to an original method name, separated by a$
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.inline.MethodNameTransformer
MethodNameTransformer.Prefixing, MethodNameTransformer.Suffixing
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
transform(MethodDescription methodDescription)
Transforms a method's name to an alternative name.static MethodNameTransformer
withRandomSuffix()
Creates a new suffixing method name transformer which adds a default suffix with a random name component.
-
-
-
Constructor Detail
-
Suffixing
public Suffixing(String suffix)
Creates a new suffixing method name transformer.- Parameters:
suffix
- The suffix to add to the method name before the seed.
-
-
Method Detail
-
withRandomSuffix
public static MethodNameTransformer withRandomSuffix()
Creates a new suffixing method name transformer which adds a default suffix with a random name component.- Returns:
- A method name transformer that adds a randomized suffix to the original method name.
-
transform
public String transform(MethodDescription methodDescription)
Transforms a method's name to an alternative name. This name must not be equal to any existing method of the created class.- Specified by:
transform
in interfaceMethodNameTransformer
- Parameters:
methodDescription
- The original method.- Returns:
- The alternative name.
-
-