View Javadoc
1   package org.csveed.common;
2   
3   public class ColumnNameKey extends ColumnKey {
4   
5       private final String columnName;
6   
7       public ColumnNameKey(String columnName) {
8           this.columnName = columnName;
9       }
10  
11      @Override
12      public int compareTo(ColumnKey columnKey) {
13          if (!sameKeyType(columnKey)) {
14              return keyTypeCompare(columnKey);
15          }
16          return this.columnName.compareTo(((ColumnNameKey)columnKey).columnName);
17      }
18  
19      @Override
20      public boolean equals(Object obj) {
21          if (!(obj instanceof ColumnNameKey)) {
22              return false;
23          }
24          return compareTo((ColumnNameKey)obj) == 0;
25      }
26  
27      @Override
28      public int hashCode() {
29          return columnName.hashCode();
30      }
31  
32      @Override
33      public String toString() {
34          return "Column Name: "+columnName;
35      }
36  
37      @Override
38      public Integer getPriority() {
39          return 2;
40      }
41  }