@@ -26,6 +26,7 @@ public abstract class CreateBucketBaseArgs extends BucketArgs {
2626 protected CreateBucketConfiguration .Location locationConfig ;
2727 protected CreateBucketConfiguration .Bucket bucket ;
2828 protected Tags tags ;
29+ protected boolean forceCreate ;
2930
3031 protected CreateBucketBaseArgs () {}
3132
@@ -35,6 +36,7 @@ protected CreateBucketBaseArgs(CreateBucketBaseArgs args) {
3536 this .locationConfig = args .locationConfig ;
3637 this .bucket = args .bucket ;
3738 this .tags = args .tags ;
39+ this .forceCreate = args .forceCreate ;
3840 }
3941
4042 public boolean objectLock () {
@@ -53,6 +55,10 @@ public Tags tags() {
5355 return tags ;
5456 }
5557
58+ public boolean forceCreate () {
59+ return forceCreate ;
60+ }
61+
5662 /** Base argument builder of {@link CreateBucketBaseArgs}. */
5763 @ SuppressWarnings ("unchecked" ) // Its safe to type cast to B as B is inherited by this class
5864 public abstract static class Builder <B extends Builder <B , A >, A extends CreateBucketBaseArgs >
@@ -81,6 +87,11 @@ public B tags(Tags tags) {
8187 operations .add (args -> args .tags = tags );
8288 return (B ) this ;
8389 }
90+
91+ public B forceCreate (boolean forceCreate ) {
92+ operations .add (args -> args .forceCreate = forceCreate );
93+ return (B ) this ;
94+ }
8495 }
8596
8697 @ Override
@@ -92,11 +103,12 @@ public boolean equals(Object o) {
92103 return objectLock == that .objectLock
93104 && Objects .equals (locationConfig , that .locationConfig )
94105 && Objects .equals (bucket , that .bucket )
95- && Objects .equals (tags , that .tags );
106+ && Objects .equals (tags , that .tags )
107+ && forceCreate == that .forceCreate ;
96108 }
97109
98110 @ Override
99111 public int hashCode () {
100- return Objects .hash (super .hashCode (), objectLock , locationConfig , bucket , tags );
112+ return Objects .hash (super .hashCode (), objectLock , locationConfig , bucket , tags , forceCreate );
101113 }
102114}
0 commit comments