public Builder dependsOn()

in src/main/java/com/twitter/nodes/Node.java [522:534]


    public Builder<T> dependsOn(Enum name, Node node) {
      initDependencyMap(name.getClass());
      // Wrap this node if its dependency state is optional and the node is not already wrapped.
      // The node.isOptional() is mostly for backward compatibility as we may sometimes pass in
      // an optional-wrapped node using the new-style builder.
      // TODO(wangtian): remove the isOptional() check after we clean up all such cases.
      Node dependency = isDependencyOptional(name) && !node.isOptional()
          ? Node.optional(node)
          : node;
      Preconditions.checkArgument(dependentNodesByName.put(name, dependency) == null,
          "You have already added a dependent node named " + name);
      return this;
    }