You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2016/12/20 11:26:34 UTC

[38/50] [abbrv] kylin git commit: minor, add equals and hashcode to RowKeyColDesc

minor, add equals and hashcode to RowKeyColDesc


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/7446c56b
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/7446c56b
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/7446c56b

Branch: refs/heads/master-hbase1.x
Commit: 7446c56b1aca87fce9868c9e1f0674299b05c405
Parents: 1d53ce9
Author: lidongsjtu <li...@apache.org>
Authored: Sat Dec 17 13:46:22 2016 +0800
Committer: lidongsjtu <li...@apache.org>
Committed: Mon Dec 19 12:57:14 2016 +0800

----------------------------------------------------------------------
 .../apache/kylin/cube/model/RowKeyColDesc.java  | 26 ++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/7446c56b/core-cube/src/main/java/org/apache/kylin/cube/model/RowKeyColDesc.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/RowKeyColDesc.java b/core-cube/src/main/java/org/apache/kylin/cube/model/RowKeyColDesc.java
index 3b49323..ef34a9b 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/RowKeyColDesc.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/RowKeyColDesc.java
@@ -155,8 +155,34 @@ public class RowKeyColDesc {
     }
 
     @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((column == null) ? 0 : column.hashCode());
+        return result;
+    }
+
+    @Override
     public String toString() {
         return Objects.toStringHelper(this).add("column", column).add("encoding", encoding).toString();
     }
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+
+        RowKeyColDesc that = (RowKeyColDesc) o;
+
+        if (column != null ? !column.equals(that.column) : that.column != null) {
+            return false;
+        }
+
+        return true;
+    }
 }
\ No newline at end of file