1aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins/** 2aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * Copyright (C) 2008 Google Inc. 3aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * 4aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * Licensed under the Apache License, Version 2.0 (the "License"); 5aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * you may not use this file except in compliance with the License. 6aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * You may obtain a copy of the License at 7aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * 8aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * http://www.apache.org/licenses/LICENSE-2.0 9aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * 10aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * Unless required by applicable law or agreed to in writing, software 11aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * distributed under the License is distributed on an "AS IS" BASIS, 12aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * See the License for the specific language governing permissions and 14aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * limitations under the License. 15aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins */ 16aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins 17aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkinspackage com.google.inject.grapher; 18aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins 19aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins/** 20b71955639ab617e0a4115b1439c8b9982227a018sberlin * Node for an interface type that has been bound to an implementation class or instance. 21aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * 22aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * @see BindingEdge 23aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins * @author phopkins@gmail.com (Pete Hopkins) 24646e1742c047dc9a768f2bc065b33e9b5ab49006cgdecker * @since 4.0 (since 2.0 as an interface) 25aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins */ 26b71955639ab617e0a4115b1439c8b9982227a018sberlinpublic class InterfaceNode extends Node { 27b71955639ab617e0a4115b1439c8b9982227a018sberlin public InterfaceNode(NodeId id, Object source) { 28b71955639ab617e0a4115b1439c8b9982227a018sberlin super(id, source); 29b71955639ab617e0a4115b1439c8b9982227a018sberlin } 30b71955639ab617e0a4115b1439c8b9982227a018sberlin 31b71955639ab617e0a4115b1439c8b9982227a018sberlin @Override public Node copy(NodeId id) { 32b71955639ab617e0a4115b1439c8b9982227a018sberlin return new InterfaceNode(id, getSource()); 33b71955639ab617e0a4115b1439c8b9982227a018sberlin } 34b71955639ab617e0a4115b1439c8b9982227a018sberlin 35b71955639ab617e0a4115b1439c8b9982227a018sberlin @Override public boolean equals(Object obj) { 36b71955639ab617e0a4115b1439c8b9982227a018sberlin return (obj instanceof InterfaceNode) && super.equals(obj); 37b71955639ab617e0a4115b1439c8b9982227a018sberlin } 38aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins 39b71955639ab617e0a4115b1439c8b9982227a018sberlin @Override public String toString() { 40b71955639ab617e0a4115b1439c8b9982227a018sberlin return "InterfaceNode{id=" + getId() + " source=" + getSource() + "}"; 41aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins } 42aff72e051a38af75e8a6bce59d1a9a4b760d914bphopkins} 43