Package net.bytebuddy

Class NamingStrategy.Suffixing

    • Field Detail

      • JAVA_PACKAGE

        private static final java.lang.String JAVA_PACKAGE
        The package prefix of the java.* packages for which the definition of non-bootstrap types is illegal.
        See Also:
        Constant Field Values
      • suffix

        private final java.lang.String suffix
        The suffix to attach to a super type name.
      • javaLangPackagePrefix

        private final java.lang.String javaLangPackagePrefix
        The renaming location for types of the JAVA_PACKAGE.
    • Constructor Detail

      • Suffixing

        public Suffixing​(java.lang.String suffix)
        Creates an immutable naming strategy with a given suffix but moves types that subclass types within the java.lang package into Byte Buddy's package namespace. All names are derived from the unnamed type's super type.
        Parameters:
        suffix - The suffix for the generated class.
      • Suffixing

        public Suffixing​(java.lang.String suffix,
                         java.lang.String javaLangPackagePrefix)
        Creates an immutable naming strategy with a given suffix but moves types that subclass types within the java.lang package into Byte Buddy's package namespace.
        Parameters:
        suffix - The suffix for the generated class.
        javaLangPackagePrefix - The fallback namespace for type's that subclass types within the java.* namespace. If The prefix is set to the empty string, no prefix is added.
      • Suffixing

        public Suffixing​(java.lang.String suffix,
                         NamingStrategy.Suffixing.BaseNameResolver baseNameResolver)
        Creates an immutable naming strategy with a given suffix but moves types that subclass types within the java.lang package into Byte Buddy's package namespace.
        Parameters:
        suffix - The suffix for the generated class.
        baseNameResolver - The base name resolver that is queried for locating the base name.
      • Suffixing

        public Suffixing​(java.lang.String suffix,
                         NamingStrategy.Suffixing.BaseNameResolver baseNameResolver,
                         java.lang.String javaLangPackagePrefix)
        Creates an immutable naming strategy with a given suffix but moves types that subclass types within the java.lang package into a given namespace.
        Parameters:
        suffix - The suffix for the generated class.
        baseNameResolver - The base name resolver that is queried for locating the base name.
        javaLangPackagePrefix - The fallback namespace for type's that subclass types within the java.* namespace. If The prefix is set to the empty string, no prefix is added.
    • 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.