Top Description Inners Methods
net.bytebuddy.dynamic.scaffold.inline

public Interface MethodNameTransformer

Known Direct Implementers
net.bytebuddy.dynamic.scaffold.inline.MethodNameTransformer.Suffixing, net.bytebuddy.dynamic.scaffold.inline.MethodNameTransformer.Prefixing
Imports
net.bytebuddy.build.HashCodeAndEqualsPlugin, net.bytebuddy.description.method.MethodDescription, net.bytebuddy.utility.RandomString

A method name transformer provides a unique mapping of a method's name to an alternative name.
See Also
MethodRebaseResolver

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
MethodNameTransformer.Prefixing

A method name transformer that adds a fixed prefix to an original method name.

public static class
MethodNameTransformer.Suffixing

A method name transformer that adds a fixed suffix to an original method name, separated by a $.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The alternative name.
transform
(MethodDescription
The original method.
methodDescription
)

Transforms a method's name to an alternative name.

Method Detail

transformback to summary
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.

Parameters
methodDescription:MethodDescription

The original method.

Returns:String

The alternative name.

net.bytebuddy.dynamic.scaffold.inline back to summary

public Class MethodNameTransformer.Prefixing

extends Object
implements MethodNameTransformer
Class Inheritance
  • java.lang.Object
  • net.bytebuddy.dynamic.scaffold.inline.MethodNameTransformer.Prefixing
All Implemented Interfaces
net.bytebuddy.dynamic.scaffold.inline.MethodNameTransformer
Annotations
@Enhance

A method name transformer that adds a fixed prefix to an original method name.

Field Summary

Modifier and TypeField and Description
private static final String
DEFAULT_PREFIX

The default prefix to add to an original method name.

private final String
prefix

The prefix that is appended.

Constructor Summary

AccessConstructor and Description
public
Prefixing()

Creates a new prefixing method name transformer using a default prefix.

public
Prefixing(String
The prefix being used.
prefix
)

Creates a new prefixing method name transformer.

Method Summary

Modifier and TypeMethod and Description
public String
transform(MethodDescription
The original method.
methodDescription
)

Implements net.bytebuddy.dynamic.scaffold.inline.MethodNameTransformer.transform.

Transforms a method's name to an alternative name.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_PREFIXback to summary
private static final String DEFAULT_PREFIX

The default prefix to add to an original method name.

prefixback to summary
private final String prefix

The prefix that is appended.

Constructor Detail

Prefixingback to summary
public Prefixing()

Creates a new prefixing method name transformer using a default prefix.

Prefixingback to summary
public Prefixing(String prefix)

Creates a new prefixing method name transformer.

Parameters
prefix:String

The prefix being used.

Method Detail

transformback to summary
public String transform(MethodDescription methodDescription)

Implements net.bytebuddy.dynamic.scaffold.inline.MethodNameTransformer.transform.

Doc from net.bytebuddy.dynamic.scaffold.inline.MethodNameTransformer.transform.

Transforms a method's name to an alternative name. This name must not be equal to any existing method of the created class.

Parameters
methodDescription:MethodDescription

The original method.

Returns:String

The alternative name.

net.bytebuddy.dynamic.scaffold.inline back to summary

public Class MethodNameTransformer.Suffixing

extends Object
implements MethodNameTransformer
Class Inheritance
  • java.lang.Object
  • net.bytebuddy.dynamic.scaffold.inline.MethodNameTransformer.Suffixing
All Implemented Interfaces
net.bytebuddy.dynamic.scaffold.inline.MethodNameTransformer
Annotations
@Enhance

A method name transformer that adds a fixed suffix to an original method name, separated by a $.

Field Summary

Modifier and TypeField and Description
private static final String
DEFAULT_SUFFIX

The default suffix to add to an original method name.

private final String
suffix

The suffix to append to a method name.

Constructor Summary

AccessConstructor and Description
public
Suffixing(String
The suffix to add to the method name before the seed.
suffix
)

Creates a new suffixing method name transformer.

Method Summary

Modifier and TypeMethod and Description
public String
transform(MethodDescription
The original method.
methodDescription
)

Implements net.bytebuddy.dynamic.scaffold.inline.MethodNameTransformer.transform.

Transforms a method's name to an alternative name.
public static MethodNameTransformer

Returns:

A method name transformer that adds a randomized suffix to the original method name.
withRandomSuffix
()

Creates a new suffixing method name transformer which adds a default suffix with a random name component.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_SUFFIXback to summary
private static final String DEFAULT_SUFFIX

The default suffix to add to an original method name.

suffixback to summary
private final String suffix

The suffix to append to a method name.

Constructor Detail

Suffixingback to summary
public Suffixing(String suffix)

Creates a new suffixing method name transformer.

Parameters
suffix:String

The suffix to add to the method name before the seed.

Method Detail

transformback to summary
public String transform(MethodDescription methodDescription)

Implements net.bytebuddy.dynamic.scaffold.inline.MethodNameTransformer.transform.

Doc from net.bytebuddy.dynamic.scaffold.inline.MethodNameTransformer.transform.

Transforms a method's name to an alternative name. This name must not be equal to any existing method of the created class.

Parameters
methodDescription:MethodDescription

The original method.

Returns:String

The alternative name.

withRandomSuffixback to summary
public static MethodNameTransformer withRandomSuffix()

Creates a new suffixing method name transformer which adds a default suffix with a random name component.

Returns:MethodNameTransformer

A method name transformer that adds a randomized suffix to the original method name.