net.sf.cglib.core

## Interface NamingPolicy

- All Known Implementing Classes:
    DefaultNamingPolicy

      public interface NamingPolicy

  Customize the generated class name for `AbstractClassGenerator`-based utilities.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object o)` The `NamingPolicy` in use does not currently, but may in the future, affect the caching of classes generated by `AbstractClassGenerator`, so this is a reminder that you should correctly implement `equals` and `hashCode` to avoid generating too many classes.
    `java.lang.String` | `getClassName(java.lang.String prefix, java.lang.String source, java.lang.Object key, Predicate names)` Choose a name for a generated class.

- - ### Method Detail

    - #### getClassName

          java.lang.String getClassName(java.lang.String prefix,
                                      java.lang.String source,
                                      java.lang.Object key,
                                      Predicate names)

      Choose a name for a generated class.
      Parameters:
        `prefix` - a dotted-name chosen by the generating class (possibly to put the generated class in a particular package)
        `source` - the fully-qualified class name of the generating class (for example "net.sf.cglib.Enhancer")
        `key` - A key object representing the state of the parameters; for caching to work properly, equal keys should result in the same generated class name. The default policy incorporates `key.hashCode()` into the class name.
        `names` - a predicate that returns true if the given classname has already been used in the same ClassLoader.
      Returns:
        the fully-qualified class name

    - #### equals

          boolean equals(java.lang.Object o)

      The `NamingPolicy` in use does not currently, but may in the future, affect the caching of classes generated by `AbstractClassGenerator`, so this is a reminder that you should correctly implement `equals` and `hashCode` to avoid generating too many classes.
      Overrides:
        `equals` in class `java.lang.Object`

Copyright (c) 2001 - Apache Software Foundation