Skip to content

Commit b2f5ef7

Browse files
author
ryo
committed
add comment for datakey hash
1 parent 2a3c7a8 commit b2f5ef7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/io/ascending/training/structure/DataKey.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.ascending.training.structure;
22

3+
import java.util.Objects;
4+
35
public class DataKey {
46

57
private String name;
@@ -32,9 +34,11 @@ public int hashCode() {
3234
int result = 1;
3335
result = prime * result + id;
3436
result = prime * result + ((name == null) ? 0 : name.hashCode());
37+
// Objects.hash(id,name);
3538
return result;
3639
}
3740

41+
// dataKey1.equals(dataKey2)
3842
@Override
3943
public boolean equals(Object obj) {
4044
if (this == obj)

0 commit comments

Comments
 (0)