Skip to content

Commit c0ab3cf

Browse files
auto commit
1 parent fdbc27d commit c0ab3cf

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

src/main/java/software/amazon/encryption/s3/S3EncryptionClientException.java

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
public class S3EncryptionClientException extends SdkClientException {
88

9+
private S3EncryptionClientException(Builder b) {
10+
super(b);
11+
}
12+
913
public S3EncryptionClientException(String message) {
1014
super(SdkClientException.builder()
1115
.message(message));
@@ -16,4 +20,51 @@ public S3EncryptionClientException(String message, Throwable cause) {
1620
.message(message)
1721
.cause(cause));
1822
}
23+
24+
@Override
25+
public Builder toBuilder() {
26+
return new BuilderImpl(this);
27+
}
28+
29+
public static Builder builder() {
30+
return new BuilderImpl();
31+
}
32+
33+
public interface Builder extends SdkClientException.Builder {
34+
@Override
35+
Builder message(String message);
36+
37+
@Override
38+
Builder cause(Throwable cause);
39+
40+
@Override
41+
S3EncryptionClientException build();
42+
}
43+
44+
protected static final class BuilderImpl extends SdkClientException.BuilderImpl implements Builder {
45+
46+
protected BuilderImpl() {
47+
}
48+
49+
protected BuilderImpl(S3EncryptionClientException ex) {
50+
super(ex);
51+
}
52+
53+
@Override
54+
public Builder message(String message) {
55+
this.message = message;
56+
return this;
57+
}
58+
59+
@Override
60+
public Builder cause(Throwable cause) {
61+
this.cause = cause;
62+
return this;
63+
}
64+
65+
@Override
66+
public S3EncryptionClientException build() {
67+
return new S3EncryptionClientException(this);
68+
}
69+
}
1970
}

0 commit comments

Comments
 (0)