File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
main/java/software/amazon/awssdk/core
test/java/software/amazon/awssdk/core Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,34 @@ public String toString() {
82
82
.build ();
83
83
}
84
84
85
+ @ Override
86
+ public boolean equals (Object o ) {
87
+ if (this == o ) {
88
+ return true ;
89
+ }
90
+ if (o == null || getClass () != o .getClass ()) {
91
+ return false ;
92
+ }
93
+
94
+ BatchOverrideConfiguration that = (BatchOverrideConfiguration ) o ;
95
+
96
+ if (maxBatchItems != null ? !maxBatchItems .equals (that .maxBatchItems ) : that .maxBatchItems != null ) {
97
+ return false ;
98
+ }
99
+ if (maxBatchOpenInMs != null ? !maxBatchOpenInMs .equals (that .maxBatchOpenInMs ) : that .maxBatchOpenInMs != null ) {
100
+ return false ;
101
+ }
102
+ return scheduledExecutor .equals (that .scheduledExecutor );
103
+ }
104
+
105
+ @ Override
106
+ public int hashCode () {
107
+ int result = maxBatchItems != null ? maxBatchItems .hashCode () : 0 ;
108
+ result = 31 * result + (maxBatchOpenInMs != null ? maxBatchOpenInMs .hashCode () : 0 );
109
+ result = 31 * result + scheduledExecutor .hashCode ();
110
+ return result ;
111
+ }
112
+
85
113
public static final class Builder implements CopyableBuilder <Builder , BatchOverrideConfiguration > {
86
114
87
115
private Integer maxBatchItems ;
Original file line number Diff line number Diff line change @@ -53,11 +53,13 @@ public void createNewBatchOverrideConfiguration() {
53
53
}
54
54
55
55
@ Test
56
- public void creatingCopyWithToBuilder () {
56
+ public void creatingCopyWithToBuilderAndCheckEqual () {
57
57
BatchOverrideConfiguration overrideConfigurationCopy = overrideConfiguration .toBuilder ().build ();
58
58
Assert .assertEquals (maxBatchItems , overrideConfigurationCopy .maxBatchItems ().intValue ());
59
59
Assert .assertEquals (maxBatchOpenInMs , overrideConfigurationCopy .maxBatchOpenInMs ().toMillis ());
60
60
Assert .assertEquals (scheduledExecutor , overrideConfigurationCopy .scheduledExecutor ());
61
+ Assert .assertEquals (overrideConfiguration , overrideConfigurationCopy );
62
+ Assert .assertEquals (overrideConfiguration .hashCode (), overrideConfigurationCopy .hashCode ());
61
63
}
62
64
63
65
@ Test
You can’t perform that action at this time.
0 commit comments