public interface NamingStrategy
A naming strategy for determining a fully qualified name for a dynamically created Java type.
Note that subclasses that lie within the same package as their superclass can access package-private methods of super types within the same package.
Modifier and Type | Interface and Description |
---|---|
static class |
NamingStrategy.AbstractBase
An abstract base implementation where the names of redefined and rebased types are retained.
|
static class |
NamingStrategy.PrefixingRandom
A naming strategy that creates a name by prefixing a given class and its package with another package and
by appending a random number to the class's simple name.
|
static class |
NamingStrategy.Suffixing
A naming strategy that appends a given suffix to a name, without a randomized element.
|
static class |
NamingStrategy.SuffixingRandom
A naming strategy that creates a name by concatenating:
The super classes package and name
A given suffix string
A random number
Between all these elements, a
$ sign is included into the name to improve readability. |
Modifier and Type | Field and Description |
---|---|
static String |
BYTE_BUDDY_RENAME_PACKAGE
The default package for defining types that are renamed to not be contained in the
java package. |
static String |
NO_PREFIX
Indicates that types of the
java.* package should not be prefixed. |
Modifier and Type | Method and Description |
---|---|
String |
rebase(TypeDescription typeDescription)
Determines a name for the dynamic type when rebasing the provided type.
|
String |
redefine(TypeDescription typeDescription)
Determines a name for the dynamic type when redefining the provided type.
|
String |
subclass(TypeDescription.Generic superClass)
Determines a new name when creating a new type that subclasses the provided type.
|
static final String BYTE_BUDDY_RENAME_PACKAGE
java
package.static final String NO_PREFIX
java.*
package should not be prefixed.String subclass(TypeDescription.Generic superClass)
superClass
- The super type of the created type.String redefine(TypeDescription typeDescription)
typeDescription
- The type being redefined.String rebase(TypeDescription typeDescription)
typeDescription
- The type being redefined.Copyright © 2014–2021. All rights reserved.