Module org.elasticsearch.server
Interface XContentHelper.CustomMerge
- Enclosing class:
XContentHelper
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A
FunctionalInterface
that can be used in order to customize map merges.-
Method Summary
-
Method Details
-
merge
Based on the provided arguments, compute a value to use for the given key as a merge result. If this method returns a non-null
value, then the merge result will replace the original value of the provided key in the base map. If this method returnsnull
, then:- if the values are of map type, the old and new values will be merged recursively
- otherwise, the original value will be maintained
RuntimeException
.- Parameters:
parent
- merged field's parentkey
- merged field's nameoldValue
- original value of the provided keynewValue
- the new value of the provided key which is to be merged with the original- Returns:
- the merged value to use for the given key, or
null
if there is no custom merge result for it. Ifnull
is returned, the algorithm will live the original value as is, unless it is a map, in which case the new map will be merged into the old map recursively.
-