aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/moazs/MoaZSException.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv/egiz/moazs/MoaZSException.java')
-rw-r--r--src/main/java/at/gv/egiz/moazs/MoaZSException.java25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/MoaZSException.java b/src/main/java/at/gv/egiz/moazs/MoaZSException.java
index 1e86c22..dbb2894 100644
--- a/src/main/java/at/gv/egiz/moazs/MoaZSException.java
+++ b/src/main/java/at/gv/egiz/moazs/MoaZSException.java
@@ -5,9 +5,6 @@ import at.gv.zustellung.msg.xsd.PreAdviceNoteSentType;
import at.gv.zustellung.tnvz.xsd.PersonResultType;
import org.springframework.lang.Nullable;
-import java.util.concurrent.ExecutorService;
-
-
public class MoaZSException extends RuntimeException {
public static final String ERROR_MZS_MIMETYPE_MISSMATCH = "8001";
@@ -27,19 +24,16 @@ public class MoaZSException extends RuntimeException {
@Nullable
private final String appDeliveryID;
- private MoaZSException(String message, @Nullable Throwable cause, @Nullable String errorCode, @Nullable PreAdviceNoteSentType preAdviceNoteSent,
- @Nullable String deliverySystem, @Nullable String gz, @Nullable String zsDeliveryID,
- @Nullable String appDeliveryID) {
- super(message, cause);
- this.errorCode = errorCode;
- this.preAdviceNoteSent = preAdviceNoteSent;
- this.deliverySystem = deliverySystem;
- this.gz = gz;
- this.zsDeliveryID = zsDeliveryID;
- this.appDeliveryID = appDeliveryID;
+ private MoaZSException(Builder builder) {
+ super(builder.message, builder.cause);
+ this.errorCode = builder.errorCode;
+ this.preAdviceNoteSent = builder.preAdviceNoteSent;
+ this.deliverySystem = builder.deliverySystem;
+ this.gz = builder.gz;
+ this.zsDeliveryID = builder.zsDeliveryID;
+ this.appDeliveryID = builder.appDeliveryID;
}
-
public static MoaZSException moaZSException(String message, Throwable cause) {
return moaZSExceptionBuilder(message).withCause(cause).build();
}
@@ -166,8 +160,7 @@ public class MoaZSException extends RuntimeException {
}
public MoaZSException build() {
- return new MoaZSException(message, cause, errorCode, preAdviceNoteSent, deliverySystem, gz,
- zsDeliveryID, appDeliveryID);
+ return new MoaZSException(this);
}
}