From 9ecfae00dd37592b1e5fdeebb2ab0b8e9129b873 Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Mon, 13 May 2019 09:27:39 +0200 Subject: Refactor and Format Fixes in Mzs2MsgConverter - Fix: Replace MessageFormat.format with String.format - Refactor: Use Method Reference - Add Todo Item --- src/main/java/at/gv/egiz/moazs/scheme/Mzs2MsgConverter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/gv') diff --git a/src/main/java/at/gv/egiz/moazs/scheme/Mzs2MsgConverter.java b/src/main/java/at/gv/egiz/moazs/scheme/Mzs2MsgConverter.java index f7157da..751f564 100644 --- a/src/main/java/at/gv/egiz/moazs/scheme/Mzs2MsgConverter.java +++ b/src/main/java/at/gv/egiz/moazs/scheme/Mzs2MsgConverter.java @@ -53,7 +53,7 @@ public class Mzs2MsgConverter { private DeliveryRequestTypeBuilder setupBuilder(at.gv.zustellung.app2mzs.xsd.DeliveryRequestType mzsRequest) { return deliveryRequestTypeBuilder() - .withVersion("2.0.0") + .withVersion("2.0.0") //todo: remove hardcoded version .withSender(convert(mzsRequest.getSender())) .withMetaData(mzsRequest.getMetaData()) .withAttachments(convertPayloads(mzsRequest.getPayload())); @@ -159,7 +159,7 @@ public class Mzs2MsgConverter { } else if (address instanceof at.gv.zustellung.app2mzs.xsd.persondata.PostalAddressType ) { return convert((at.gv.zustellung.app2mzs.xsd.persondata.PostalAddressType) address); } else if (address instanceof at.gv.zustellung.app2mzs.xsd.persondata.TelephoneAddressType) { return convert((at.gv.zustellung.app2mzs.xsd.persondata.TelephoneAddressType) address); } else { - throw new IllegalArgumentException(format("No conversion strategy of address of type {0}", address.getClass().toGenericString())); + throw new IllegalArgumentException(format("No conversion strategy of address of type=%s.", address.getClass().toGenericString())); } } @@ -303,7 +303,7 @@ public class Mzs2MsgConverter { private List convertAffixes(List affix) { return affix.stream() - .map(mzsAffix -> convert(mzsAffix)) + .map(this::convert) .collect(toList()); } -- cgit v1.2.3