From 96e9fa1c7f7333ac4529dc1208ff22e8cd0adb54 Mon Sep 17 00:00:00 2001 From: Antonio Tarricone <110115827+antoniotarricone@users.noreply.github.com> Date: Mon, 6 Mar 2023 17:41:57 +0100 Subject: [PATCH] fix: ToStrings refactored. (#3) --- .../swclient/mil/feecalculator/ErrorCode.java | 2 +- .../mil/feecalculator/client/FeeService.java | 2 +- .../feecalculator/client/MilRestService.java | 2 +- .../client/bean/AcquirerConfiguration.java | 11 ++-- .../client/bean/GecGetFeesRequest.java | 26 +++++---- .../client/bean/GecGetFeesResponse.java | 53 +++++++++---------- .../client/bean/GecTransfer.java | 14 ++--- .../client/bean/PspConfiguration.java | 19 ++++--- 8 files changed, 68 insertions(+), 61 deletions(-) diff --git a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/ErrorCode.java b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/ErrorCode.java index 7ad855e..26e24e5 100644 --- a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/ErrorCode.java +++ b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/ErrorCode.java @@ -42,4 +42,4 @@ public final class ErrorCode { private ErrorCode() { // This class cannot be instantiated! } -} +} \ No newline at end of file diff --git a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/FeeService.java b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/FeeService.java index 4945224..757380c 100644 --- a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/FeeService.java +++ b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/FeeService.java @@ -31,4 +31,4 @@ public interface FeeService { @ClientHeaderParam(name = "Ocp-Apim-Subscription-Key", value = "${ocp.apim.subscription}", required = false) Uni> getFees(GecGetFeesRequest gecGetFeesRequest, @HeaderParam("X-Request-Id") String requestId); -} +} \ No newline at end of file diff --git a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/MilRestService.java b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/MilRestService.java index 4d7aaee..dd55e92 100644 --- a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/MilRestService.java +++ b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/MilRestService.java @@ -28,4 +28,4 @@ public interface MilRestService { @ClientHeaderParam(name = "Version", value = "${mil.acquirer-conf.version}", required = false) Uni getPspConfiguration(@HeaderParam(value = "RequestId") String requestId, @PathParam(value = "acquirerId") String acquirerId); -} +} \ No newline at end of file diff --git a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/AcquirerConfiguration.java b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/AcquirerConfiguration.java index 6c3c2f3..a8ec014 100644 --- a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/AcquirerConfiguration.java +++ b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/AcquirerConfiguration.java @@ -51,13 +51,12 @@ public void setPspConfigForGetFeeAndClosePayment(PspConfiguration pspConfigForGe this.pspConfigForGetFeeAndClosePayment = pspConfigForGetFeeAndClosePayment; } - @Override public String toString() { - final StringBuilder sb = new StringBuilder("PspConfiguration{"); - sb.append("pspConfigForVerifyAndActivate=").append(pspConfigForVerifyAndActivate); - sb.append(", pspConfigForGetFeeAndClosePayment=").append(pspConfigForGetFeeAndClosePayment); - sb.append('}'); - return sb.toString(); + return new StringBuilder("AcquirerConfiguration [pspConfigForVerifyAndActivate=") + .append(pspConfigForVerifyAndActivate) + .append(", pspConfigForGetFeeAndClosePayment=") + .append(pspConfigForGetFeeAndClosePayment) + .append("]").toString(); } } diff --git a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/GecGetFeesRequest.java b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/GecGetFeesRequest.java index 553e080..6b4130e 100644 --- a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/GecGetFeesRequest.java +++ b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/GecGetFeesRequest.java @@ -142,17 +142,21 @@ public void setTransferList(List transferList) { this.transferList = transferList; } - @Override public String toString() { - final StringBuilder sb = new StringBuilder("GecGetFeesRequest{"); - sb.append("idPspList=").append(idPspList); - sb.append(", paymentAmount=").append(paymentAmount); - sb.append(", primaryCreditorInstitution='").append(primaryCreditorInstitution).append('\''); - sb.append(", paymentMethod='").append(paymentMethod).append('\''); - sb.append(", touchpoint='").append(touchpoint).append('\''); - sb.append(", transferList=").append(transferList); - sb.append('}'); - return sb.toString(); + return new StringBuilder("GecGetFeesRequest [idPspList=") + .append(idPspList) + .append(", paymentAmount=") + .append(paymentAmount) + .append(", primaryCreditorInstitution=") + .append(primaryCreditorInstitution) + .append(", paymentMethod=") + .append(paymentMethod) + .append(", touchpoint=") + .append(touchpoint) + .append(", transferList=") + .append(transferList) + .append("]") + .toString(); } -} +} \ No newline at end of file diff --git a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/GecGetFeesResponse.java b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/GecGetFeesResponse.java index 8680316..f6936a6 100644 --- a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/GecGetFeesResponse.java +++ b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/GecGetFeesResponse.java @@ -233,32 +233,31 @@ public void setTouchpoint(String touchpoint) { @Override public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("FeeServiceResponse [bundleDescription="); - builder.append(bundleDescription); - builder.append(", bundleName="); - builder.append(bundleName); - builder.append(", idBrokerPsp="); - builder.append(idBrokerPsp); - builder.append(", idBundle="); - builder.append(idBundle); - builder.append(", idChannel="); - builder.append(idChannel); - builder.append(", idCiBundle="); - builder.append(idCiBundle); - builder.append(", idPsp="); - builder.append(idPsp); - builder.append(", onUs="); - builder.append(onUs); - builder.append(", paymentMethod="); - builder.append(paymentMethod); - builder.append(", primaryCiIncurredFee="); - builder.append(primaryCiIncurredFee); - builder.append(", taxPayerFee="); - builder.append(taxPayerFee); - builder.append(", touchpoint="); - builder.append(touchpoint); - builder.append("]"); - return builder.toString(); + return new StringBuilder("FeeServiceResponse [bundleDescription=") + .append(bundleDescription) + .append(", bundleName=") + .append(bundleName) + .append(", idBrokerPsp=") + .append(idBrokerPsp) + .append(", idBundle=") + .append(idBundle) + .append(", idChannel=") + .append(idChannel) + .append(", idCiBundle=") + .append(idCiBundle) + .append(", idPsp=") + .append(idPsp) + .append(", onUs=") + .append(onUs) + .append(", paymentMethod=") + .append(paymentMethod) + .append(", primaryCiIncurredFee=") + .append(primaryCiIncurredFee) + .append(", taxPayerFee=") + .append(taxPayerFee) + .append(", touchpoint=") + .append(touchpoint) + .append("]") + .toString(); } } diff --git a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/GecTransfer.java b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/GecTransfer.java index be5af7e..ad03a59 100644 --- a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/GecTransfer.java +++ b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/GecTransfer.java @@ -71,11 +71,13 @@ public void setTransferCategory(String transferCategory) { @Override public String toString() { - final StringBuilder sb = new StringBuilder("GecTransfer{"); - sb.append("creditorInstitution='").append(creditorInstitution).append('\''); - sb.append(", digitalStamp=").append(digitalStamp); - sb.append(", transferCategory='").append(transferCategory).append('\''); - sb.append('}'); - return sb.toString(); + return new StringBuilder("GecTransfer [creditorInstitution=") + .append(creditorInstitution) + .append(", digitalStamp=") + .append(digitalStamp) + .append(", transferCategory=") + .append(transferCategory) + .append("]") + .toString(); } } \ No newline at end of file diff --git a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/PspConfiguration.java b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/PspConfiguration.java index 9ec3e86..422a029 100644 --- a/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/PspConfiguration.java +++ b/src/main/java/it/gov/pagopa/swclient/mil/feecalculator/client/bean/PspConfiguration.java @@ -93,12 +93,15 @@ public void setPassword(String password) { @Override public String toString() { - final StringBuilder sb = new StringBuilder("PspConfiguration{"); - sb.append("psp='").append(psp).append('\''); - sb.append(", broker='").append(broker).append('\''); - sb.append(", channel='").append(channel).append('\''); - sb.append(", password='").append(password).append('\''); - sb.append('}'); - return sb.toString(); + return new StringBuilder("PspConfiguration [psp=") + .append(psp) + .append(", broker=") + .append(broker) + .append(", channel=") + .append(channel) + .append(", password=") + .append(password) + .append("]") + .toString(); } -} +} \ No newline at end of file