Class PathTrie<T>

java.lang.Object
org.elasticsearch.common.path.PathTrie<T>

public class PathTrie<T>
extends java.lang.Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static interface  PathTrie.Decoder  
    class  PathTrie.TrieNode  
  • Constructor Summary

    Constructors
    Constructor Description
    PathTrie​(PathTrie.Decoder decoder)  
  • Method Summary

    Modifier and Type Method Description
    void insert​(java.lang.String path, T value)  
    void insertOrUpdate​(java.lang.String path, T value, java.util.function.BiFunction<T,​T,​T> updater)
    Insert a value for the given path.
    T retrieve​(java.lang.String path)  
    T retrieve​(java.lang.String path, java.util.Map<java.lang.String,​java.lang.String> params)  
    T retrieve​(java.lang.String path, java.util.Map<java.lang.String,​java.lang.String> params, org.elasticsearch.common.path.PathTrie.TrieMatchingMode trieMatchingMode)  
    java.util.Iterator<T> retrieveAll​(java.lang.String path, java.util.function.Supplier<java.util.Map<java.lang.String,​java.lang.String>> paramSupplier)
    Returns an iterator of the objects stored in the PathTrie, using all possible TrieMatchingMode modes.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • insert

      public void insert​(java.lang.String path, T value)
    • insertOrUpdate

      public void insertOrUpdate​(java.lang.String path, T value, java.util.function.BiFunction<T,​T,​T> updater)
      Insert a value for the given path. If the path already exists, replace the value with:
       value = updater.apply(oldValue, newValue);
       
      allowing the value to be updated if desired.
    • retrieve

      public T retrieve​(java.lang.String path)
    • retrieve

      public T retrieve​(java.lang.String path, java.util.Map<java.lang.String,​java.lang.String> params)
    • retrieve

      public T retrieve​(java.lang.String path, java.util.Map<java.lang.String,​java.lang.String> params, org.elasticsearch.common.path.PathTrie.TrieMatchingMode trieMatchingMode)
    • retrieveAll

      public java.util.Iterator<T> retrieveAll​(java.lang.String path, java.util.function.Supplier<java.util.Map<java.lang.String,​java.lang.String>> paramSupplier)
      Returns an iterator of the objects stored in the PathTrie, using all possible TrieMatchingMode modes. The paramSupplier is called between each invocation of next() to supply a new map of parameters.