|
17 | 17 |
|
18 | 18 | import androidx.annotation.NonNull; |
19 | 19 | import androidx.annotation.Nullable; |
| 20 | +import androidx.core.util.ObjectsCompat; |
20 | 21 |
|
21 | 22 | import com.amplifyframework.api.graphql.GraphQLResponse; |
22 | 23 | import com.amplifyframework.api.graphql.MutationType; |
@@ -51,31 +52,6 @@ private OutboxMutationFailedEvent( |
51 | 52 | this.model = model; |
52 | 53 | } |
53 | 54 |
|
54 | | - @Override |
55 | | - public boolean equals(Object obj) { |
56 | | - if (this == obj) { |
57 | | - return true; |
58 | | - } |
59 | | - if (obj == null || getClass() != obj.getClass()) { |
60 | | - return false; |
61 | | - } |
62 | | - OutboxMutationFailedEvent<?> that = (OutboxMutationFailedEvent<?>) obj; |
63 | | - return getErrorType() == that.getErrorType() && |
64 | | - getOperation() == that.getOperation() && |
65 | | - getModelName().equals(that.getModelName()) && |
66 | | - getModel().equals(that.getModel()); |
67 | | - } |
68 | | - |
69 | | - @Override |
70 | | - public int hashCode() { |
71 | | - return Objects.hash( |
72 | | - getErrorType(), |
73 | | - getOperation(), |
74 | | - getModelName(), |
75 | | - getModel() |
76 | | - ); |
77 | | - } |
78 | | - |
79 | 55 | /** |
80 | 56 | * Constructs an outbox mutation error event. |
81 | 57 | * @param pendingMutation pending mutation that failed to publish |
@@ -139,6 +115,31 @@ public HubEvent<OutboxMutationFailedEvent<M>> toHubEvent() { |
139 | 115 | return HubEvent.create(DataStoreChannelEventName.OUTBOX_MUTATION_FAILED, this); |
140 | 116 | } |
141 | 117 |
|
| 118 | + @Override |
| 119 | + public boolean equals(Object obj) { |
| 120 | + if (this == obj) { |
| 121 | + return true; |
| 122 | + } |
| 123 | + if (obj == null || getClass() != obj.getClass()) { |
| 124 | + return false; |
| 125 | + } |
| 126 | + OutboxMutationFailedEvent<?> that = (OutboxMutationFailedEvent<?>) obj; |
| 127 | + return getErrorType() == that.getErrorType() && |
| 128 | + getOperation() == that.getOperation() && |
| 129 | + getModelName().equals(that.getModelName()) && |
| 130 | + getModel().equals(that.getModel()); |
| 131 | + } |
| 132 | + |
| 133 | + @Override |
| 134 | + public int hashCode() { |
| 135 | + return ObjectsCompat.hash( |
| 136 | + getErrorType(), |
| 137 | + getOperation(), |
| 138 | + getModelName(), |
| 139 | + getModel() |
| 140 | + ); |
| 141 | + } |
| 142 | + |
142 | 143 | @Override |
143 | 144 | public String toString() { |
144 | 145 | return "OutboxMutationFailedEvent{" + |
|
0 commit comments