repeated

public static FloggerMetadataKey<T> repeated<T>(String label, Class<T> clazz)

Creates a key for a repeated piece of metadata. If metadata is added more than once using this key for a log statement, all values will be retained as key/value pairs in the order they were added.

Key instances behave like singletons, and two key instances with the same label will still be considered distinct. The recommended approach is to always assign MetadataKey instances to static final constants.

When calling from Kotlin, please give preference to MetadataKeysKt.repeatedKey(). In Kotlin, there's no explicit difference between primitive and object classes. When compiling to JVM, it is resolved during the compilation. An accident passing of a potentially primitive class may lead to a runtime exception because metadata keys are used with generics.