getMetadataValue

inline fun <T> Entity.getMetadataValue(key: String): T?

Retrieves metadata value from this entity for the specified key.

This is a convenience extension function that retrieves the first metadata value associated with the given key and attempts to cast it to the specified type.

Return

The metadata value cast to type T, or null if no metadata exists for the key or if the value cannot be cast to the specified type

Parameters

key

The metadata key to retrieve

Type Parameters

T

The expected type of the metadata value