@Test public void testRoundTrip() throws IOException { DAGNode<Job> node = new DAGNode<Job>("scope-1", new Job("job-1", null, null)); DAGNode<Job> child = new DAGNode<Job>("scope-2", new Job("job-2", null, null)); node.setSuccessors(ImmutableList.<DAGNode<? extends Job>>of(child)); testRoundTrip(node); }
public synchronized void setSuccessors(Collection<DAGNode<? extends Job>> successors) { Collection<String> successorNames = new HashSet<String>(); if (successors != null) { for(DAGNode node : successors) { successorNames.add(node.getName()); } } this.successors = successors; this.successorNames = successorNames; }
DAGNode { public synchronized void setSuccessors(Collection<DAGNode<? extends Job>> successors) { Collection<String> successorNames = new HashSet<String>(); if (successors != null) { for(DAGNode node : successors) { successorNames.add(node.getName()); } } this.successors = successors; this.successorNames = successorNames; } }
DAGNode { public synchronized void setSuccessors(Collection<DAGNode<? extends Job>> successors) { Collection<String> successorNames = new HashSet<String>(); if (successors != null) { for(DAGNode node : successors) { successorNames.add(node.getName()); } } this.successors = successors; this.successorNames = successorNames; } @JsonCreator  DAGNode(@JsonProperty("name") String name,
                 @JsonProperty("job") T job); }
DAGNode { public synchronized void setSuccessors(Collection<DAGNode<? extends Job>> successors) { Collection<String> successorNames = new HashSet<String>(); if (successors != null) { for(DAGNode node : successors) { successorNames.add(node.getName()); } } this.successors = successors; this.successorNames = successorNames; } @JsonCreator  DAGNode(@JsonProperty("name") String name,
                 @JsonProperty("job") T job); String getName(); T getJob(); synchronized Collection<DAGNode<? extends Job>> getSuccessors(); synchronized void setSuccessors(Collection<DAGNode<? extends Job>> successors); synchronized Collection<String> getSuccessorNames(); @Override int hashCode(); @Override boolean equals(Object obj); String toJson(); static DAGNode<? extends Job> fromJson(String json); @SuppressWarnings("unchecked") static void main(String[] args); }
DAGNode { public synchronized void setSuccessors(Collection<DAGNode<? extends Job>> successors) { Collection<String> successorNames = new HashSet<String>(); if (successors != null) { for(DAGNode node : successors) { successorNames.add(node.getName()); } } this.successors = successors; this.successorNames = successorNames; } @JsonCreator  DAGNode(@JsonProperty("name") String name,
                 @JsonProperty("job") T job); String getName(); T getJob(); synchronized Collection<DAGNode<? extends Job>> getSuccessors(); synchronized void setSuccessors(Collection<DAGNode<? extends Job>> successors); synchronized Collection<String> getSuccessorNames(); @Override int hashCode(); @Override boolean equals(Object obj); String toJson(); static DAGNode<? extends Job> fromJson(String json); @SuppressWarnings("unchecked") static void main(String[] args);  }