public class GraphUtil
extends java.lang.Object
Constructor and Description |
---|
GraphUtil() |
Modifier and Type | Method and Description |
---|---|
static java.util.Set<java.lang.String> |
getTopDownOrder(java.util.Map<java.lang.String,java.util.Set<java.lang.String>> graph)
Check cyclic dependency and determine processing order for the given graph.
|
static java.util.Map<java.lang.String,java.lang.Object> |
mergeNestableMap(java.util.Map<java.lang.String,java.lang.Object> original,
java.util.Map<java.lang.String,java.lang.Object> additional)
Deep-merge a map into another map returning a result map.
|
public static java.util.Map<java.lang.String,java.lang.Object> mergeNestableMap(java.util.Map<java.lang.String,java.lang.Object> original, java.util.Map<java.lang.String,java.lang.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 java.util.Set<java.lang.String> getTopDownOrder(java.util.Map<java.lang.String,java.util.Set<java.lang.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