Interface CollectionHelper
-
- All Known Implementing Classes:
DefaultCollectionHelper
public interface CollectionHelperAn interface for collection helper functions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.function.BinaryOperator<java.lang.Object>defaultDeepMergeFunction()Resolver for twoMapvalues that have the same key.java.util.Map<java.lang.String,java.lang.Object>mergeMaps(java.util.List<java.util.Map<java.lang.String,java.lang.Object>> maps)Merges the list of maps.java.util.Map<java.lang.String,java.lang.Object>mergeMaps(java.util.List<java.util.Map<java.lang.String,java.lang.Object>> maps, java.util.function.BinaryOperator<java.lang.Object> mergeFunction)Merges the list of maps.java.util.Map<java.lang.String,java.lang.Object>mergeMaps(java.util.Map<java.lang.String,java.lang.Object> firstMap, java.util.Map<java.lang.String,java.lang.Object> secondMap, java.util.function.BinaryOperator<java.lang.Object> mergeFunction)Merges two maps.
-
-
-
Method Detail
-
mergeMaps
java.util.Map<java.lang.String,java.lang.Object> mergeMaps(java.util.Map<java.lang.String,java.lang.Object> firstMap, java.util.Map<java.lang.String,java.lang.Object> secondMap, java.util.function.BinaryOperator<java.lang.Object> mergeFunction)Merges two maps. If a value already exists for a given key in a resulting map
then the mergeFunction is used to resolve the issue.- Parameters:
firstMap- theMapto mergesecondMap- theMapto mergemergeFunction- the function used to resolve conflict for the same key- Returns:
- the
Map
-
mergeMaps
java.util.Map<java.lang.String,java.lang.Object> mergeMaps(java.util.List<java.util.Map<java.lang.String,java.lang.Object>> maps, java.util.function.BinaryOperator<java.lang.Object> mergeFunction)Merges the list of maps. If a value already exists for a given key in a resulting map
then the mergeFunction is used to resolve the issue.- Parameters:
maps- theListofMap.mergeFunction- the function used to resolve conflict for the same key- Returns:
- the
Map
-
mergeMaps
java.util.Map<java.lang.String,java.lang.Object> mergeMaps(java.util.List<java.util.Map<java.lang.String,java.lang.Object>> maps)
Merges the list of maps.- Parameters:
maps- theListofMap.- Returns:
- the
Map
-
defaultDeepMergeFunction
java.util.function.BinaryOperator<java.lang.Object> defaultDeepMergeFunction()
Resolver for twoMapvalues that have the same key.- Returns:
- the
BinaryOperatorto merge two values with the same key.
-
-