package net.jaekl.cfb.db;
+import net.jaekl.cfb.util.Util;
+
// Copyright (C) 2015 Christian Jaekl
public class Column {
return new Column(name, type, width.intValue(), canBeNull);
}
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (null == obj) {
+ return false;
+ }
+ if (! (obj instanceof Column)) {
+ return false;
+ }
+ Column other = (Column)obj;
+
+ if (! Util.objsAreEqual(this.getName(), other.getName())) {
+ return false;
+ }
+ if (! Util.objsAreEqual(this.getType(), other.getType())) {
+ return false;
+ }
+ if (this.getWidth() != other.getWidth()) {
+ return false;
+ }
+ if (! Util.objsAreEqual(this.getNull(), other.getNull())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int code = Util.objHashCode(getName())
+ ^ Util.objHashCode(getType())
+ ^ getWidth()
+ ^ Util.objHashCode(getNull());
+ return code;
+ }
}