Package org.elasticsearch.common.path
Class PathTrie<T>
- java.lang.Object
-
- org.elasticsearch.common.path.PathTrie<T>
-
public class PathTrie<T> extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePathTrie.DecoderclassPathTrie.TrieNode
-
Constructor Summary
Constructors Constructor Description PathTrie(PathTrie.Decoder decoder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinsert(String path, T value)voidinsertOrUpdate(String path, T value, BiFunction<T,T,T> updater)Insert a value for the given path.Tretrieve(String path)Tretrieve(String path, Map<String,String> params)Tretrieve(String path, Map<String,String> params, org.elasticsearch.common.path.PathTrie.TrieMatchingMode trieMatchingMode)Iterator<T>retrieveAll(String path, Supplier<Map<String,String>> paramSupplier)Returns an iterator of the objects stored in thePathTrie, using all possibleTrieMatchingModemodes.
-
-
-
Constructor Detail
-
PathTrie
public PathTrie(PathTrie.Decoder decoder)
-
-
Method Detail
-
insertOrUpdate
public void insertOrUpdate(String path, T value, 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(String path, Map<String,String> params, org.elasticsearch.common.path.PathTrie.TrieMatchingMode trieMatchingMode)
-
retrieveAll
public Iterator<T> retrieveAll(String path, Supplier<Map<String,String>> paramSupplier)
Returns an iterator of the objects stored in thePathTrie, using all possibleTrieMatchingModemodes. TheparamSupplieris called between each invocation ofnext()to supply a new map of parameters.
-
-