Package org.elasticsearch.common.path
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 interfacePathTrie.DecoderclassPathTrie.TrieNode
-
Constructor Summary
Constructors Constructor Description PathTrie(PathTrie.Decoder decoder)
-
Method Summary
Modifier and Type Method Description voidinsert(java.lang.String path, T value)voidinsertOrUpdate(java.lang.String path, T value, java.util.function.BiFunction<T,T,T> updater)Insert a value for the given path.Tretrieve(java.lang.String path)Tretrieve(java.lang.String path, java.util.Map<java.lang.String,java.lang.String> params)Tretrieve(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 thePathTrie, using all possibleTrieMatchingModemodes.
-
-
-
Constructor Detail
-
PathTrie
public PathTrie(PathTrie.Decoder decoder)
-
-
Method Detail
-
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 thePathTrie, using all possibleTrieMatchingModemodes. TheparamSupplieris called between each invocation ofnext()to supply a new map of parameters.
-
-