Interface MessageFormatter
- All Superinterfaces:
Function<DeserializingMessage,
String>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface MessageFormatter
extends Function<DeserializingMessage,String>
A functional interface for formatting
DeserializingMessage
instances into human-readable strings.
This interface is typically used to customize how messages are represented in logs or UI displays. The formatter
receives a DeserializingMessage
, which may or may not have been fully deserialized at the time of
formatting.
Implementations can decide whether to format based on metadata, payload class, or raw type information.
Default Implementation
TheDEFAULT
formatter returns:
- The simple name of the payload class if the message is already deserialized
- The type string (usually the fully qualified class name) otherwise
Example usage:
String label = MessageFormatter.DEFAULT.apply(message);
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MessageFormatter
The default formatter that returns the simple name of the payload class if deserialized, or the raw type string if not. -
Method Summary
-
Field Details
-
DEFAULT
The default formatter that returns the simple name of the payload class if deserialized, or the raw type string if not.
-