Package net.bytebuddy

Class NamingStrategy.PrefixingRandom

  • All Implemented Interfaces:
    NamingStrategy
    Enclosing interface:
    NamingStrategy

    @Enhance
    public static class NamingStrategy.PrefixingRandom
    extends NamingStrategy.AbstractBase
    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.
    • Field Detail

      • prefix

        private final java.lang.String prefix
        The package to prefix.
    • Constructor Detail

      • PrefixingRandom

        public PrefixingRandom​(java.lang.String prefix)
        Creates a new prefixing random naming strategy.
        Parameters:
        prefix - The prefix to append.
    • Method Detail

      • name

        protected java.lang.String name​(TypeDescription superClass)
        Description copied from class: NamingStrategy.AbstractBase
        Determines a new name when creating a new type that subclasses the provided type.
        Specified by:
        name in class NamingStrategy.AbstractBase
        Parameters:
        superClass - The super type of the created type.
        Returns:
        The name of the dynamic type.