File tree 2 files changed +64
-0
lines changed
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping
2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
package org .springframework .data .mongodb .core .mapping ;
17
17
18
+ import java .util .Objects ;
19
+
18
20
/**
19
21
* @author Christoph Strobl
22
+ * @author Rogério Meneguelli Gatto
20
23
* @since 3.2
21
24
*/
22
25
class UnwrapEntityContext {
@@ -30,4 +33,34 @@ public UnwrapEntityContext(MongoPersistentProperty property) {
30
33
public MongoPersistentProperty getProperty () {
31
34
return property ;
32
35
}
36
+
37
+ /*
38
+ * (non-Javadoc)
39
+ *
40
+ * @see java.lang.Object#hashCode()
41
+ */
42
+ @ Override
43
+ public int hashCode () {
44
+ return Objects .hash (property );
45
+ }
46
+
47
+ /*
48
+ * (non-Javadoc)
49
+ *
50
+ * @see java.lang.Object#equals(java.lang.Object)
51
+ */
52
+ @ Override
53
+ public boolean equals (Object obj ) {
54
+ if (this == obj ) {
55
+ return true ;
56
+ }
57
+
58
+ if (obj == null || getClass () != obj .getClass ()) {
59
+ return false ;
60
+ }
61
+
62
+ UnwrapEntityContext other = (UnwrapEntityContext ) obj ;
63
+
64
+ return Objects .equals (property , other .property );
65
+ }
33
66
}
Original file line number Diff line number Diff line change 18
18
import java .lang .annotation .Annotation ;
19
19
import java .lang .reflect .Field ;
20
20
import java .lang .reflect .Method ;
21
+ import java .util .Objects ;
21
22
22
23
import org .springframework .data .mapping .Association ;
23
24
import org .springframework .data .mapping .PersistentEntity ;
29
30
* Unwrapped variant of {@link MongoPersistentProperty}.
30
31
*
31
32
* @author Christoph Strobl
33
+ * @author Rogério Meneguelli Gatto
32
34
* @since 3.2
33
35
* @see Unwrapped
34
36
*/
@@ -321,4 +323,33 @@ public <T> PersistentPropertyAccessor<T> getAccessorForOwner(T owner) {
321
323
return delegate .getAccessorForOwner (owner );
322
324
}
323
325
326
+ /*
327
+ * (non-Javadoc)
328
+ *
329
+ * @see java.lang.Object#hashCode()
330
+ */
331
+ @ Override
332
+ public int hashCode () {
333
+ return Objects .hash (delegate , context );
334
+ }
335
+
336
+ /*
337
+ * (non-Javadoc)
338
+ *
339
+ * @see java.lang.Object#equals(java.lang.Object)
340
+ */
341
+ @ Override
342
+ public boolean equals (Object obj ) {
343
+ if (this == obj ) {
344
+ return true ;
345
+ }
346
+
347
+ if (obj == null || getClass () != obj .getClass ()) {
348
+ return false ;
349
+ }
350
+
351
+ UnwrappedMongoPersistentProperty other = (UnwrappedMongoPersistentProperty ) obj ;
352
+
353
+ return Objects .equals (delegate , other .delegate ) && Objects .equals (context , other .context );
354
+ }
324
355
}
You can’t perform that action at this time.
0 commit comments