Enum Class Parameter
- All Implemented Interfaces:
Serializable
,Comparable<Parameter>
,Constable
Enumerates the names of parameters that may be subject to validation
within the MessageBuilder library.
Each enum constant corresponds to a symbolic parameter name used in validation methods and exception messages. This design provides compile-time safety, IDE auto-completion, and helps ensure consistency across the codebase.
The displayName
associated with each parameter is used in
localized messages and can be retrieved via getDisplayName()
.
Example usage:
throw new ValidationException(PARAMETER_NULL, Parameter.COMMAND_SENDER);
Inspired by the best practices outlined in "Effective Java" (Joshua Bloch), this approach avoids stringly-typed parameter keys while enabling internationalization support via structured message formatting.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionReturns the canonical display name for this parameter, as used in localized error messages.toString()
Returns the display name of the parameter.static Parameter
Returns the enum constant of this class with the specified name.static Parameter[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ADAPTER
-
CONTEXT_MAP
-
COMMAND_SENDER
-
CONFIGURATION_SUPPLIER
-
DELEGATE
-
DEPENDENCY_CONTEXT
-
DURATION
-
ENTITY
-
ITEM_SECTION
-
KEY
-
LANGUAGE_FILE
-
LANGUAGE_QUERY_HANDLER
-
LANGUAGE_RESOURCE_MANAGER
-
LANGUAGE_TAG
-
LOCALE
-
LOCALE_PROVIDER
-
LOCATION
-
LOWER_BOUND
-
MACRO
-
MACRO_KEY
-
MESSAGE
-
MESSAGE_ID
-
MESSAGE_PROCESSOR
-
MESSAGE_SECTION
-
MESSAGE_RECORD
-
MESSAGE_STRING
-
NAME
-
PLACEHOLDER
-
PLUGIN
-
PRECISION
-
QUANTITY
-
QUERY_HANDLER
-
RECIPIENT
-
RECORD_TYPE
-
REPLACEMENT_MAP
-
FORMATTER_CONTAINER
-
RESOURCE_INSTALLER
-
RESOURCE_LOADER
-
RESOURCE_NAME
-
RESOURCE_TYPE
-
SECTION
-
SECTION_SUPPLIER
-
TARGET_DIR_PATH
-
TYPE
-
UNIQUE_ID
-
UNKNOWN
-
VALUE
-
WORLD
-
-
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
-
getDisplayName
Returns the canonical display name for this parameter, as used in localized error messages.- Returns:
- the parameter's display name
-
toString
Returns the display name of the parameter. Equivalent togetDisplayName()
.
-