@@ -211,6 +211,36 @@ public String toString() {
211
211
return String .format ("[items=%s, skips=%s]" , items , skips );
212
212
}
213
213
214
+ @ Override
215
+ public boolean equals (Object obj ) {
216
+ if (obj == this ) {
217
+ return true ;
218
+ }
219
+ if (!(obj instanceof Chunk )) {
220
+ return false ;
221
+ }
222
+ Chunk <?> other = (Chunk <?>) obj ;
223
+ return Objects .equals (this .items , other .items ) &&
224
+ Objects .equals (this .skips , other .skips ) &&
225
+ Objects .equals (this .errors , other .errors ) &&
226
+ Objects .equals (this .userData , other .userData ) &&
227
+ this .end == other .end &&
228
+ this .busy == other .busy ;
229
+ }
230
+
231
+ @ Override
232
+ public int hashCode () {
233
+ int result = 17 ;
234
+ result = 31 * result + items .hashCode ();
235
+ result = 31 * result + skips .hashCode ();
236
+ result = 31 * result + errors .hashCode ();
237
+ result = 31 * result + Objects .hashCode (userData );
238
+ result = 31 * result + (end ? 1 : 0 );
239
+ result = 31 * result + (busy ? 1 : 0 );
240
+ return result ;
241
+ }
242
+
243
+
214
244
/**
215
245
* Special iterator for a chunk providing the {@link #remove(Throwable)} method for
216
246
* dynamically removing an item and adding it to the skips.
@@ -262,25 +292,6 @@ public String toString() {
262
292
return String .format ("[items=%s, skips=%s]" , items , skips );
263
293
}
264
294
265
- @ Override
266
- public int hashCode () {
267
- return Objects .hash (items , skips , errors , userData , end , busy );
268
- }
269
-
270
- @ Override
271
- public boolean equals (Object obj ) {
272
- if (this == obj ) {
273
- return true ;
274
- }
275
- if (!(obj instanceof Chunk )) {
276
- return false ;
277
- }
278
- Chunk <?> other = (Chunk <?>) obj ;
279
- return Objects .equals (items , other .items ) && Objects .equals (skips , other .skips )
280
- && Objects .equals (errors , other .errors ) && Objects .equals (userData , other .userData )
281
- && end == other .end && busy == other .busy ;
282
- }
283
-
284
295
}
285
296
286
297
}
0 commit comments