View Javadoc

1   /*
2    * $Id: Target.java 454251 2006-10-09 02:10:57Z husted $
3    *
4    * Copyright 2006 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.struts2.sitegraph.entities;
19  
20  
21  /***
22   */
23  public class Target {
24      private String target;
25      private int type;
26  
27      public Target(String target, int type) {
28          this.target = target;
29          this.type = type;
30      }
31  
32      public String getTarget() {
33          return target;
34      }
35  
36      public int getType() {
37          return type;
38      }
39  
40      public boolean equals(Object o) {
41          if (this == o) return true;
42          if (!(o instanceof Target)) return false;
43  
44          final Target target1 = (Target) o;
45  
46          if (type != target1.type) return false;
47          if (target != null ? !target.equals(target1.target) : target1.target != null) return false;
48  
49          return true;
50      }
51  
52      public int hashCode() {
53          int result;
54          result = (target != null ? target.hashCode() : 0);
55          result = 29 * result + type;
56          return result;
57      }
58  }