Interface CollectionHelper

All Known Implementing Classes:
DefaultCollectionHelper

public interface CollectionHelper
An interface for collection helper functions.
  • Method Details

    • mergeMaps

      Map<String,Object> mergeMaps(Map<String,Object> firstMap, Map<String,Object> secondMap, BinaryOperator<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 - the Map to merge
      secondMap - the Map to merge
      mergeFunction - the function used to resolve conflict for the same key
      Returns:
      the Map
    • mergeMaps

      Map<String,Object> mergeMaps(List<Map<String,Object>> maps, BinaryOperator<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 - the List of Map.
      mergeFunction - the function used to resolve conflict for the same key
      Returns:
      the Map
    • mergeMaps

      Map<String,Object> mergeMaps(List<Map<String,Object>> maps)
      Merges the list of maps.
      Parameters:
      maps - the List of Map.
      Returns:
      the Map
    • defaultDeepMergeFunction

      BinaryOperator<Object> defaultDeepMergeFunction()
      Resolver for two Map values that have the same key.
      Returns:
      the BinaryOperator to merge two values with the same key.