Interface XAddGetMap<K,​V>

    • Method Detail

      • substitute

        KeyValue<K,​V> substitute​(K key,
                                       V value)
      • ensure

        V ensure​(K key,
                 Function<? super K,​V> valueProvider)
        Ensures that this map instance contains a non-null value for the passed key and returns that value.

        If a non-null value can be found for the passed key, it is returned. Otherwise, the value provided by the passed supplier will be associated with the passed key and is returned.

        Parameters:
        key - the search key.
        valueProvider - the value supplier used to provide a value for the passed key in case non could be found.
        Returns:
        the value associated with the passed key, either already existing or newly assiciated by the call of this method.