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