spring-framework / org.springframework.messaging.rsocket / metadataToExtract

metadataToExtract

fun <reified T : Any> MetadataExtractorRegistry.metadataToExtract(mimeType: MimeType, name: String? = null): Unit

Extension for MetadataExtractorRegistry.metadataToExtract providing a metadataToExtract<Foo>(...) variant leveraging Kotlin reified type parameters. This extension is not subject to type erasure and retains actual generic type arguments.

Parameters

mimeType - the mime type of metadata entries to extract

name - assign a name for the decoded value; if not provided, then the mime type is used as the key

T - the target value type to decode to

Author
Sebastien Deleuze

Since
5.2

inline fun <reified T : Any> MetadataExtractorRegistry.metadataToExtract(mimeType: MimeType, noinline mapper: (T, MutableMap<String, Any>) -> Unit): Unit

Extension for MetadataExtractorRegistry.metadataToExtract providing a metadataToExtract<Foo>(...) variant leveraging Kotlin reified type parameters. This extension is not subject to type erasure and retains actual generic type arguments.

Parameters

mimeType - the mime type of metadata entries to extract

mapper - custom logic to add the decoded value to the output map

T - the target value type to decode to

Author
Sebastien Deleuze

Since
5.2