Skip to content

Commit

Permalink
Rename equals to baseEquals and hashCode to baseHashCode in JobInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
mziccard committed Jan 22, 2016
1 parent e1ddedb commit e11a5ae
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ ToStringHelper toStringHelper() {

@Override
public boolean equals(Object obj) {
return obj instanceof CopyJobInfo && Objects.equals(toPb(), ((CopyJobInfo) obj).toPb());
return obj instanceof CopyJobInfo && baseEquals((CopyJobInfo) obj);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), sourceTables, destinationTable, createDisposition,
return Objects.hash(baseHashCode(), sourceTables, destinationTable, createDisposition,
writeDisposition);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ ToStringHelper toStringHelper() {

@Override
public boolean equals(Object obj) {
return obj instanceof ExtractJobInfo && Objects.equals(toPb(), ((ExtractJobInfo) obj).toPb());
return obj instanceof ExtractJobInfo && baseEquals((ExtractJobInfo) obj);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), sourceTable, destinationUris, printHeader, fieldDelimiter,
return Objects.hash(baseHashCode(), sourceTable, destinationUris, printHeader, fieldDelimiter,
format, compression);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,12 @@ public String toString() {
return toStringHelper().toString();
}

@Override
public int hashCode() {
protected final int baseHashCode() {
return Objects.hash(jobId);
}

@Override
public boolean equals(Object obj) {
return obj instanceof JobInfo && Objects.equals(toPb(), ((JobInfo) obj).toPb());
protected final boolean baseEquals(JobInfo jobInfo) {
return Objects.equals(toPb(), jobInfo.toPb());
}

Job toPb() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ ToStringHelper toStringHelper() {

@Override
public boolean equals(Object obj) {
return obj instanceof LoadJobInfo && Objects.equals(toPb(), ((LoadJobInfo) obj).toPb());
return obj instanceof LoadJobInfo && baseEquals((LoadJobInfo) obj);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), sourceUris, configuration);
return Objects.hash(baseHashCode(), sourceUris, configuration);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,12 +447,12 @@ ToStringHelper toStringHelper() {

@Override
public boolean equals(Object obj) {
return obj instanceof QueryJobInfo && Objects.equals(toPb(), ((QueryJobInfo) obj).toPb());
return obj instanceof QueryJobInfo && baseEquals((QueryJobInfo) obj);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), allowLargeResults, createDisposition, destinationTable,
return Objects.hash(baseHashCode(), allowLargeResults, createDisposition, destinationTable,
defaultDataset, flattenResults, priority, query, tableDefinitions, useQueryCache,
userDefinedFunctions, writeDisposition, dryRun);
}
Expand Down

0 comments on commit e11a5ae

Please sign in to comment.