1 /*
2 * CSVeed (https://github.com/42BV/CSVeed)
3 *
4 * Copyright 2013-2023 CSVeed.
5 *
6 * All rights reserved. This program and the accompanying materials
7 * are made available under the terms of The Apache Software License,
8 * Version 2.0 which accompanies this distribution, and is available at
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 */
11 package org.csveed.common;
12
13 /**
14 * The Class ColumnKey.
15 */
16 public abstract class ColumnKey implements Comparable<ColumnKey> {
17
18 /**
19 * Gets the priority.
20 *
21 * @return the priority
22 */
23 public abstract Integer getPriority();
24
25 /**
26 * Same key type.
27 *
28 * @param columnKey
29 * the column key
30 *
31 * @return true, if successful
32 */
33 public boolean sameKeyType(ColumnKey columnKey) {
34 return getPriority().equals(columnKey.getPriority());
35 }
36
37 /**
38 * Key type compare.
39 *
40 * @param columnKey
41 * the column key
42 *
43 * @return the int
44 */
45 public int keyTypeCompare(ColumnKey columnKey) {
46 return getPriority().compareTo(columnKey.getPriority());
47 }
48
49 }