View Javadoc

1   /**
2    * Copyright (C) 2008 Atlassian
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *    http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package com.atlassian.theplugin.idea.crucible;
18  
19  import com.atlassian.theplugin.commons.crucible.api.model.CrucibleFileInfo;
20  
21  import javax.swing.tree.DefaultMutableTreeNode;
22  
23  /**
24   * Created by IntelliJ IDEA.
25   * User: pmaruszak
26   * Date: Jun 10, 2008
27   * Time: 3:08:00 PM
28   * To change this template use File | Settings | File Templates.
29   */
30  public class ReviewItemDataNode extends DefaultMutableTreeNode {
31  	static final long serialVersionUID = -1192703287399203290L;
32  
33  	private CrucibleFileInfo file;
34  
35  	public ReviewItemDataNode(CrucibleFileInfo aReviewItemData) {
36  		this.file = aReviewItemData;
37  	}
38  
39  	public CrucibleFileInfo getFile() {
40  		return file;
41  	}
42  
43  	public void setFile(CrucibleFileInfo file) {
44  		this.file = file;
45  	}
46  
47  	public String toString() {
48  		return file.toString();
49  	}
50  
51  	public boolean equals(Object o) {
52  		if (this == o) {
53  			return true;
54  		}
55  		if (o == null || getClass() != o.getClass()) {
56  			return false;
57  		}
58  
59  		ReviewItemDataNode that = (ReviewItemDataNode) o;
60  
61  		if (file.equals(that.file)) {
62  			return false;
63  		}
64  
65  		return true;
66  	}
67  
68  	public int hashCode() {
69  		return file.hashCode();
70  	}
71  }
72