-
public class MapCompanion<K extends Object, E extends Object>Encapsulates a Map into a more limited query API.
This is most useful as an Enum companion, to provide parsing of raw values.
enum class Layout(val value: String) { PAGINATED("paginated"), REFLOWABLE("reflowable"); companion object : KeyMapper<String, Layout>(values(), Layout::value) } val layout: Layout? = Layout("reflowable")
-
-
Constructor Summary
Constructors Constructor Description MapCompanion(Array<E> elements, Function1<E, K> keySelector)MapCompanion(Map<K, E> map)
-
Method Summary
-
-
Method Detail
-
get
E get(K key)
Returns the element matching the key, or null if not found.
To be overridden in subclasses if custom retrieval is needed – for example, testing lowercase keys.
-
from
@Deprecated(message = Use `Enum("value")` instead, replaceWith = @ReplaceWith(imports = {}, expression = get(key)), level = DeprecationLevel.ERROR) E from(K key)
-
-
-
-