1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.atlassian.jira.rest.client.api.domain;
18
19 import com.atlassian.jira.rest.client.api.domain.util.ErrorCollection;
20 import com.google.common.base.Objects;
21
22
23
24
25
26
27
28 public class BulkOperationErrorResult {
29 private final ErrorCollection elementErrors;
30 private final Integer failedElementNumber;
31
32 public BulkOperationErrorResult(final ErrorCollection errors, final Integer failedElementNumber) {
33 this.elementErrors = errors;
34 this.failedElementNumber = failedElementNumber;
35 }
36
37 @SuppressWarnings("unused")
38 public ErrorCollection getElementErrors() {
39 return elementErrors;
40 }
41
42 @SuppressWarnings("unused")
43 public Integer getFailedElementNumber() {
44 return failedElementNumber;
45 }
46
47
48 @Override
49 public String toString() {
50 return Objects.toStringHelper(this)
51 .add("elementErrors", elementErrors)
52 .add("failedElementNumber", failedElementNumber)
53 .toString();
54
55 }
56
57 @Override
58 public boolean equals(final Object obj) {
59 if (obj instanceof BulkOperationErrorResult) {
60 final BulkOperationErrorResult that = (BulkOperationErrorResult) obj;
61 return Objects.equal(this.elementErrors, that.elementErrors)
62 && Objects.equal(this.failedElementNumber, that.failedElementNumber);
63 }
64 return false;
65 }
66
67 @Override
68 public int hashCode() {
69 return Objects.hashCode(elementErrors, failedElementNumber);
70 }
71 }