File tree 1 file changed +22
-0
lines changed
src/main/java/org/springframework/data/elasticsearch/core/join
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
package org .springframework .data .elasticsearch .core .join ;
17
17
18
+ import java .util .Objects ;
19
+
20
+ import org .springframework .data .annotation .PersistenceConstructor ;
18
21
import org .springframework .lang .Nullable ;
19
22
20
23
/**
21
24
* @author Subhobrata Dey
25
+ * @author Sascha Woo
22
26
* @since 4.1
23
27
*/
24
28
public class JoinField <ID > {
@@ -35,6 +39,7 @@ public JoinField(String name) {
35
39
this (name , null );
36
40
}
37
41
42
+ @ PersistenceConstructor
38
43
public JoinField (String name , @ Nullable ID parent ) {
39
44
this .name = name ;
40
45
this .parent = parent ;
@@ -52,4 +57,21 @@ public ID getParent() {
52
57
public String getName () {
53
58
return name ;
54
59
}
60
+
61
+ @ Override
62
+ public int hashCode () {
63
+ return Objects .hash (name , parent );
64
+ }
65
+
66
+ @ Override
67
+ public boolean equals (Object obj ) {
68
+ if (this == obj ) {
69
+ return true ;
70
+ }
71
+ if (!(obj instanceof JoinField )) {
72
+ return false ;
73
+ }
74
+ JoinField other = (JoinField ) obj ;
75
+ return Objects .equals (name , other .name ) && Objects .equals (parent , other .parent );
76
+ }
55
77
}
You can’t perform that action at this time.
0 commit comments