View Javadoc

1   /*
2    * This file is part of hyphenType. hyphenType is free software: you can
3    * redistribute it and/or modify it under the terms of the GNU General Public
4    * License as published by the Free Software Foundation, either version 3 of the
5    * License, or (at your option) any later version. hyphenType is distributed in
6    * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
7    * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
8    * the GNU General Public License for more details. You should have received a
9    * copy of the GNU General Public License along with hyphenType. If not, see
10   * <http://www.gnu.org/licenses/>.
11   */
12  package org.hyphenType.datastructure.parser.simple;
13  
14  import java.lang.reflect.Method;
15  import java.util.List;
16  
17  import org.hyphenType.datastructure.annotations.InputChannel;
18  import org.hyphenType.datastructure.parser.StructureArgument;
19  
20  /**
21   * @author Aurelio Akira M. Matsui
22   */
23  public class StructureSimpleArgument extends StructureArgument {
24  
25      public StructureSimpleArgument(final Method method, final String name, final boolean mandatory, final int index, final String regex, final List<InputChannel> channels, final String description) {
26          super(name, method, mandatory, index, regex, channels, description);
27      }
28  
29      @Override
30      public String toString() {
31          return "[ method = " + method + " ]";
32      }
33  
34      @Override
35      public boolean equals(Object obj) {
36          if (!(obj instanceof StructureSimpleArgument))
37              return false;
38          StructureSimpleArgument other = (StructureSimpleArgument) obj;
39          return other.method.equals(this.method);
40      }
41  
42      @Override
43      public int hashCode() {
44          return method.hashCode();
45      }
46  }