Enum Class ClassNameFormat
- All Implemented Interfaces:
Serializable,Comparable<ClassNameFormat>,Constable
Controls which parts of the fully qualified class name are included in the output.
Example:
See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassNameFormatReturns the enum constant of this class with the specified name.static ClassNameFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FULL
Full name including package and outer classes.Examples:
"java.lang.String" "java.util.Map$Entry" or"java.util.Map.Entry" (depending on separator)"com.example.Outer$Inner$Deep"
This format includes the complete package path and all enclosing class names. The separator character between outer and inner classes is configurable.
-
SHORT
Short name including outer classes but not the package.Examples:
"String" "Map$Entry" or"Map.Entry" (depending on separator)"Outer$Inner$Deep"
This format includes enclosing class names but omits the package. Useful when the package context is already known or not needed. The separator character between outer and inner classes is configurable.
-
SIMPLE
Simple name without package or outer classes.Examples:
"String" "Entry" "Deep"
This format returns only the innermost class name, omitting both the package and any enclosing class names. This is equivalent to
Class.getSimpleName().
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-