public class GraphUtil extends Object
Constructor and Description |
---|
GraphUtil() |
Modifier and Type | Method and Description |
---|---|
static Set<String> |
getTopDownOrder(Map<String,Set<String>> graph)
Check cyclic dependency and determine processing order for the given graph.
|
static Map<String,Object> |
mergeNestableMap(Map<String,Object> original,
Map<String,Object> additional)
Deep-merge a map into another map returning a result map.
|
public static Map<String,Object> mergeNestableMap(Map<String,Object> original, Map<String,Object> additional)
Copies all values present in the original map to a new map, adding additional value present in the second map passed in, ignoring same-key values in the second map that are present in the original.
If the value is a Map itself, repeats the operation on the Map value.
original
- nestable Map of entries to retain and not overwriteadditional
- nestable Map of entries to add to the originalpublic static Set<String> getTopDownOrder(Map<String,Set<String>> graph) throws GraphCircularDependencyException
graph
- is represented as child nodes that have one or more parent nodes that they are dependent onGraphCircularDependencyException
- if a dependency has been detected