1
15
16 package software.amazon.awssdk.protocols.core;
17
18 import java.util.function.Supplier;
19 import software.amazon.awssdk.annotations.SdkProtectedApi;
20 import software.amazon.awssdk.core.SdkPojo;
21
22
25 @SdkProtectedApi
26 public final class ExceptionMetadata {
27
28 private final String errorCode;
29 private final Supplier<SdkPojo> exceptionBuilderSupplier;
30 private final Integer httpStatusCode;
31
32 private ExceptionMetadata(Builder builder) {
33 this.errorCode = builder.errorCode;
34 this.exceptionBuilderSupplier = builder.exceptionBuilderSupplier;
35 this.httpStatusCode = builder.httpStatusCode;
36 }
37
38
41 public String errorCode() {
42 return errorCode;
43 }
44
45
48 public Supplier<SdkPojo> exceptionBuilderSupplier() {
49 return exceptionBuilderSupplier;
50 }
51
52
56 public Integer httpStatusCode() {
57 return httpStatusCode;
58 }
59
60 public static Builder builder() {
61 return new Builder();
62 }
63
64
67 public static final class Builder {
68 private String errorCode;
69 private Supplier<SdkPojo> exceptionBuilderSupplier;
70 private Integer httpStatusCode;
71
72 private Builder() {
73 }
74
75 public Builder errorCode(String errorCode) {
76 this.errorCode = errorCode;
77 return this;
78 }
79
80 public Builder exceptionBuilderSupplier(Supplier<SdkPojo> exceptionBuilderSupplier) {
81 this.exceptionBuilderSupplier = exceptionBuilderSupplier;
82 return this;
83 }
84
85 public Builder httpStatusCode(Integer httpStatusCode) {
86 this.httpStatusCode = httpStatusCode;
87 return this;
88 }
89
90 public ExceptionMetadata build() {
91 return new ExceptionMetadata(this);
92 }
93 }
94 }
95