@Nonnull public DAGNode<V,E> build() { Preconditions.checkState(label != null, "no node label set"); return new DAGNode<V,E>(label, edges); }
/** * Create a new DAG node with no outgoing edges. * @param label The node label. * @param <V> The type of node labels. * @param <E> The type of edge labels. */ public static <V,E> DAGNode<V,E> singleton(V label) { Preconditions.checkNotNull(label, "node label"); return new DAGNode<V,E>(label, ImmutableSet.<Pair<DAGNode<V, E>, E>>of()); }