View Javadoc

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