Interface InMemoryTrie.UpsertTransformer<T,U>

Type Parameters:
T - The content type for this InMemoryTrie.
U - The type of the new content being applied to this InMemoryTrie.
Enclosing class:
InMemoryTrie<T>

public static interface InMemoryTrie.UpsertTransformer<T,U>
Somewhat similar to Trie.MergeResolver, this encapsulates logic to be applied whenever new content is being upserted into a InMemoryTrie. Unlike Trie.MergeResolver, InMemoryTrie.UpsertTransformer will be applied no matter if there's pre-existing content for that trie key/path or not.
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(T existing, U update)
    Called when there's content in the updating trie.
  • Method Details

    • apply

      T apply(T existing, U update)
      Called when there's content in the updating trie.
      Parameters:
      existing - Existing content for this key, or null if there isn't any.
      update - The update, always non-null.
      Returns:
      The combined value to use. Cannot be null.