- All Implemented Interfaces:
Serializable
,Comparable<EventFormatter>
,Constable
The EventFormatter enum provides different formatting strategies for event logs.
Each formatter formats the event metadata and arguments in a specific way.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe CSV formatter formats the event metadata and arguments in a CSV format.The DEFAULT formatter formats the event metadata and arguments in a default format.The JSON formatter formats the event metadata and arguments in a JSON format.The KEY_VALUE formatter formats the event metadata and arguments in a key-value format.The XML formatter formats the event metadata and arguments in an XML format. -
Method Summary
Modifier and TypeMethodDescriptionabstract String
format
(Map<String, String> metadata, KeyValueWrapper... args) Formats the event metadata and arguments.abstract String
Formats the event metadata and message.abstract String
formatArguments
(String body, KeyValueWrapper... args) Formats the event arguments.abstract String
Formats the event element.static EventFormatter
Returns the enum constant of this class with the specified name.static EventFormatter[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
The DEFAULT formatter formats the event metadata and arguments in a default format. -
KEY_VALUE
The KEY_VALUE formatter formats the event metadata and arguments in a key-value format. -
CSV
The CSV formatter formats the event metadata and arguments in a CSV format. -
XML
The XML formatter formats the event metadata and arguments in an XML format. -
JSON
The JSON formatter formats the event metadata and arguments in a JSON format.
-
-
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
-
format
Formats the event metadata and arguments.- Parameters:
metadata
- the event metadata.args
- the event arguments.- Returns:
- the formatted event as a string.
-
format
Formats the event metadata and message.- Parameters:
metadata
- the event metadata.message
- the event message.- Returns:
- the formatted event as a string.
-
formatElement
Formats the event element.- Parameters:
arg
- the event element.- Returns:
- the formatted event element as a string.
-
formatArguments
Formats the event arguments.- Parameters:
body
- the argument keyword.args
- the event arguments.- Returns:
- the formatted event arguments as a string.
-