File tree 2 files changed +65
-0
lines changed
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping
2 files changed +65
-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
*/
@@ -304,4 +306,34 @@ public Class<?> getAssociationTargetType() {
304
306
public <T > PersistentPropertyAccessor <T > getAccessorForOwner (T owner ) {
305
307
return delegate .getAccessorForOwner (owner );
306
308
}
309
+
310
+ /*
311
+ * (non-Javadoc)
312
+ *
313
+ * @see java.lang.Object#hashCode()
314
+ */
315
+ @ Override
316
+ public int hashCode () {
317
+ return Objects .hash (delegate , context );
318
+ }
319
+
320
+ /*
321
+ * (non-Javadoc)
322
+ *
323
+ * @see java.lang.Object#equals(java.lang.Object)
324
+ */
325
+ @ Override
326
+ public boolean equals (Object obj ) {
327
+ if (this == obj ) {
328
+ return true ;
329
+ }
330
+
331
+ if (obj == null || getClass () != obj .getClass ()) {
332
+ return false ;
333
+ }
334
+
335
+ UnwrappedMongoPersistentProperty other = (UnwrappedMongoPersistentProperty ) obj ;
336
+
337
+ return Objects .equals (delegate , other .delegate ) && Objects .equals (context , other .context );
338
+ }
307
339
}
You can’t perform that action at this time.
0 commit comments