Package 

Class MapWithDefaultCompanion

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final E default
      private final Set<K> keys
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final E getDefault()
      final E getOrDefault(K key) Returns the element matching the key, or the default value as a fallback.
      E invoke(K key) Alias to getOrDefault, to be used like keyMapper("a_key").
      E from(K key)
      • Methods inherited from class org.readium.r2.shared.util.MapCompanion

        get, getKeys
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MapWithDefaultCompanion

        MapWithDefaultCompanion(Array<E> elements, Function1<E, K> keySelector, E default)
      • MapWithDefaultCompanion

        MapWithDefaultCompanion(Map<K, E> map, E default)