aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/moazs/MoaZSException.java
diff options
context:
space:
mode:
authorChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-07-09 12:56:54 +0200
committerChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-07-09 12:56:54 +0200
commit65163646205b6e05139485fe957bceabe531f447 (patch)
treec35c0061a8c7e8ad3f054e632ed6ecfb1fb1b3cc /src/main/java/at/gv/egiz/moazs/MoaZSException.java
parent8e36fa01ea42d282eacdc78d6749daf9ae1ede9c (diff)
downloadmoa-zs-65163646205b6e05139485fe957bceabe531f447.tar.gz
moa-zs-65163646205b6e05139485fe957bceabe531f447.tar.bz2
moa-zs-65163646205b6e05139485fe957bceabe531f447.zip
Minor Fixes And Refactoring
- Fix typo in SafeResponseToFileSink. - MoaZSException: Simplify constructor by replacing lots of arguments with the builder instance. - Fix minor codesmells (unused imports, superfluous braces).
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);
}
}