接口 NamingPolicy
- 所有已知实现类:
DefaultNamingPolicy
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
Customize the generated class name for
AbstractClassGenerator-based
utilities.-
方法概要
修饰符和类型方法说明booleanTheNamingPolicyin use does not currently, but may in the future, affect the caching of classes generated byAbstractClassGenerator, so this is a reminder that you should correctly implementequalsandhashCodeto avoid generating too many classes.Choose a name for a generated class.
-
方法详细资料
-
getClassName
Choose a name for a generated class.- 参数:
prefix- a dotted-name chosen by the generating class (possibly to put the generated class in a particular package)source- the class simple name of the generating classkey- 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 incorporateskey.hashCode()into the class name.names- a predicate that returns true if the given classname has already been used in the same ClassLoader.- 返回:
- the fully-qualified class name
-
equals
TheNamingPolicyin use does not currently, but may in the future, affect the caching of classes generated byAbstractClassGenerator, so this is a reminder that you should correctly implementequalsandhashCodeto avoid generating too many classes.
-