5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-10 07:31:32 +08:00

SQOOP-1940: Add hashcode and equals methods to SqoopWritable

(Veena Basavaraj via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2015-01-05 11:20:49 +01:00
parent 08b2418c53
commit e8a4a97fe2

View File

@ -90,4 +90,36 @@ public void setConf(Configuration conf) {
public Configuration getConf() { public Configuration getConf() {
return conf; return conf;
} }
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((toIDF == null) ? 0 : toIDF.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
SqoopWritable other = (SqoopWritable) obj;
if (toIDF == null) {
if (other.toIDF != null)
return false;
} else if (!toIDF.equals(other.toIDF))
return false;
return true;
}
} }