java.lang.Object
org.elasticsearch.script.field.WriteField
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAppends a value to this path.protected voidCreate a new Map for each segment in path, if that segment is unmapped or mapped to null.Remove all duplicate values from this path.doc()Append aNestedDocumentto this field and return it.doc(int index) Returns aNestedDocumentat the index, if index is beyond the end of the List, creates empty NestedDocument through the end of the array to the index.docs()Iterable over allNestedDocuments in this field.booleanexists()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 providedFetch the value at the current location, changing a Map into a single element 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 pathThe painless API formove, delegates tomove(String)ormove(WriteField), throws anIllegalArgumentExceptionif is neither aStringnor aWriteField.Move this path to another path in the map.move(WriteField path) Move this path to the path of the givenWriteField, using thatWriteFields root, which may be aNestedDocument.The painless API foroverwrite, delegates tooverwrite(String)oroverwrite(WriteField), throws anIllegalArgumentExceptionif is neither aStringnor aWriteField.Move this path to another path in the map, overwriting the destination path if it exists.overwrite(WriteField path) Move this path to the path represented by anotherWriteField, using thatWriteFields root, which may be aNestedDocument.voidremove()Removes this path from the map.removeValue(int index) Remove the value at , if it exists.removeValuesIf(Predicate<Object> filter) Remove all values at this path that match .protected voidResolvepathfrom the root.Sets the value for this path.protected voidsetLeaf()Get the path to a leaf or create it if one does not exist.protected voidintsize()How many elements are at the leaf of this path?Update each value at this path with theFunction.protected StringMethods 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
-
-
Constructor Details
-
WriteField
-
-
Method Details
-
getName
Get the path represented by this Field -
exists
public boolean exists()Does the path exist? -
move
Move this path to another path in the map.- Throws:
IllegalArgumentException- if the other path has contents
-
move
Move this path to the path of the givenWriteField, using thatWriteFields root, which may be aNestedDocument.- Throws:
IllegalArgumentException- if the other path has contents
-
move
The painless API formove, delegates tomove(String)ormove(WriteField), throws anIllegalArgumentExceptionif is neither aStringnor aWriteField. This is necessary because Painless does not support method overloading, only arity overloading. -
overwrite
Move this path to another path in the map, overwriting the destination path if it exists. If this Field has no value, the value at is removed. -
overwrite
Move this path to the path represented by anotherWriteField, using thatWriteFields root, which may be aNestedDocument. Overwrites the destination path if it exists. If this Field has no value, the value at is removed. -
overwrite
The painless API foroverwrite, delegates tooverwrite(String)oroverwrite(WriteField), throws anIllegalArgumentExceptionif is neither aStringnor aWriteField. This is necessary because Painless does not support method overloading, only arity overloading. -
remove
public void remove()Removes this path from the map. -
set
Sets the value for this path. Creates nested path if necessary. -
append
Appends a value to this path. Creates the path and the List at the leaf if necessary. -
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 -
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? -
transform
Update each value at this path with theFunction. -
deduplicate
Remove all duplicate values from this path. List order is not preserved. -
removeValuesIf
Remove all values at this path that match . If there is only one value and it matches , the mapping is removed, however empty Lists are retained. -
removeValue
Remove the value at , if it exists. If there is only one value and is zero, remove the mapping. -
doc
Append aNestedDocumentto this field and return it. -
doc
Returns aNestedDocumentat the index, if index is beyond the end of the List, creates empty NestedDocument through the end of the array to the index. -
getDocsAsList
Fetch the value at the current location, changing a Map into a single element list. The new list is written back to the leaf. If there is no value, returnnull. If there is a value that is not a List or a Map, . -
docs
Iterable over allNestedDocuments in this field. -
setPath
-
setLeaf
protected void setLeaf()Get the path to a leaf or create it if one does not exist. -
resolveDepthFlat
protected 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. -
createDepth
protected void createDepth()Create a new Map for each segment in path, if that segment is unmapped or mapped to null.- Throws:
IllegalArgumentException- if a non-leaf segment maps to a non-Map Object.
-
typeName
-