Metadata Handler
Callback API for logger backend implementations to handle metadata keys/values. The API methods will be called once for each distinct key, in encounter order. Different methods are called depending on whether the key is repeatable or not.
It is expected that the most convenient way to construct a metadata handler is via the Builder class, which lets keys be individually mapped to callbacks, however the class can also just be extended to implement alternate/custom behavior.
Parameters
<C>
the arbitrary context type.
See also
<a href="https://github. com/google/flogger/blob/cb9e836a897d36a78309ee8badf5cad4e6a2d3d8/api/src/main/java/com/google/common/flogger/backend/Metadata Handler. java">
Original Java code of Google Flogger
Types
Link copied to clipboard
Builder for a map-based MetadataHandler which allows handlers to be associated with individual callbacks.
Link copied to clipboard
API for handling repeated metadata key/values in a single callback.
Link copied to clipboard
API for handling metadata key/value pairs individually.
Functions
Link copied to clipboard
public static MetadataHandler.Builder<C> builder<C>(MetadataHandler.ValueHandler<Object, C> defaultHandler)
Returns a builder for a handler with the specified default callback.
Link copied to clipboard
Handles values for a repeatable metadata key.