java.lang.Object
org.elasticsearch.script.field.SourceMapField
- Direct Known Subclasses:
WriteField
Provides an immutable view of a field in a source map.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexists()Does the path exist?Get the value at the given index at this path or if there is no such value.Get the value at this path, if there is no value then get the providedgetListIterator(List<?> list) Get an iterator for the given list that cannot mutate the underlying list.getName()Get the path represented by this FieldbooleanIs there any value matching at this path?booleanisEmpty()Is this path associated with any values?iterator()Iterate through all elements of this path with an iterator that cannot mutate the underlying map.protected final voidResolvepathfrom the root.protected voidintsize()How many elements are at the leaf of this path?Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
path
-
rootSupplier
-
container
-
leaf
-
MISSING
-
-
Constructor Details
-
SourceMapField
-
-
Method Details
-
getName
Get the path represented by this Field -
exists
public boolean exists()Does the path exist? -
isEmpty
public boolean isEmpty()Is this path associated with any values? -
size
public int size()How many elements are at the leaf of this path? -
iterator
Iterate through all elements of this path with an iterator that cannot mutate the underlying map. -
getListIterator
Get an iterator for the given list that cannot mutate the underlying list. Subclasses can override this method to allow for mutating iterators.- Parameters:
list- the list to get an iterator for- Returns:
- an iterator that cannot mutate the underlying list
-
get
Get the value at this path, if there is no value then get the provided -
get
Get the value at the given index at this path or if there is no such value. -
hasValue
Is there any value matching at this path? -
setPath
-
resolveDepthFlat
protected final void resolveDepthFlat()Resolvepathfrom the root. Tries to resolve the path one segment at a time, if the segment is not mapped to a Java Map, then treats that segment and the rest as the leaf if it resolves. a.b.c could be resolved as I) ['a']['b']['c'] if 'a' is a Map at the root and 'b' is a Map in 'a', 'c' need not exist in 'b'. II) ['a']['b.c'] if 'a' is a Map at the root and 'b' does not exist in 'a's Map but 'b.c' does. III) ['a.b.c'] if 'a' doesn't exist at the root but 'a.b.c' does.containerandleafand non-null if resolved.
-