Interface CollectionHelper

  • All Known Implementing Classes:
    DefaultCollectionHelper

    public interface CollectionHelper
    An 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 two Map values 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 - the Map to merge
        secondMap - the Map to merge
        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,
                                                                         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 - the List of Map.
        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 - the List of Map.
        Returns:
        the Map
      • defaultDeepMergeFunction

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