From 7a638c3ed6c30aee4e1c869ac545a9cecedb65e4 Mon Sep 17 00:00:00 2001 From: kkholmatov Date: Sun, 2 Apr 2023 10:53:48 +0500 Subject: [PATCH 1/2] Implemented Lombok Annotations Getter/Setter --- .../common/gsma/dto/AccessTokenDTO.java | 39 +----- .../gsma/dto/AccountBalanceResponseDTO.java | 67 +--------- .../gsma/dto/AccountNameResponseDTO.java | 12 +- .../common/gsma/dto/AccountStatus.java | 30 +---- .../common/gsma/dto/AccountStatusRequest.java | 20 +-- .../gsma/dto/AccountStatusResponseDTO.java | 13 +- .../common/gsma/dto/AuthErrorDTO.java | 34 ++--- .../common/gsma/dto/AuthorizationCodeDTO.java | 121 +----------------- .../mifos/connector/common/gsma/dto/Bill.java | 45 +------ .../mifos/connector/common/gsma/dto/Name.java | 69 ++-------- 10 files changed, 65 insertions(+), 385 deletions(-) diff --git a/src/main/java/org/mifos/connector/common/gsma/dto/AccessTokenDTO.java b/src/main/java/org/mifos/connector/common/gsma/dto/AccessTokenDTO.java index 84c256a..9e9d916 100644 --- a/src/main/java/org/mifos/connector/common/gsma/dto/AccessTokenDTO.java +++ b/src/main/java/org/mifos/connector/common/gsma/dto/AccessTokenDTO.java @@ -1,40 +1,15 @@ package org.mifos.connector.common.gsma.dto; +import lombok.*; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString public class AccessTokenDTO { private String access_token; private int expires_in; - public AccessTokenDTO() { - - } - - @Override - public String toString() { - return "AccessTokenDTO{" + - "access_token='" + access_token + '\'' + - ", expires_in=" + expires_in + - '}'; - } - - public String getAccess_token() { - return access_token; - } - - public void setAccess_token(String access_token) { - this.access_token = access_token; - } - - public int getExpires_in() { - return expires_in; - } - - public void setExpires_in(int expires_in) { - this.expires_in = expires_in; - } - - public AccessTokenDTO(String access_token, int expires_in) { - this.access_token = access_token; - this.expires_in = expires_in; - } } diff --git a/src/main/java/org/mifos/connector/common/gsma/dto/AccountBalanceResponseDTO.java b/src/main/java/org/mifos/connector/common/gsma/dto/AccountBalanceResponseDTO.java index c6a7b90..c2ba72a 100644 --- a/src/main/java/org/mifos/connector/common/gsma/dto/AccountBalanceResponseDTO.java +++ b/src/main/java/org/mifos/connector/common/gsma/dto/AccountBalanceResponseDTO.java @@ -1,5 +1,12 @@ package org.mifos.connector.common.gsma.dto; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +@Getter +@Setter +@ToString public class AccountBalanceResponseDTO { private String currentBalance; private String availableBalance; @@ -7,64 +14,4 @@ public class AccountBalanceResponseDTO { private String unclearedBalance; private String currency; private String accountStatus; - - public String getCurrentBalance() { - return currentBalance; - } - - public void setCurrentBalance(String currentBalance) { - this.currentBalance = currentBalance; - } - - public String getAvailableBalance() { - return availableBalance; - } - - public void setAvailableBalance(String availableBalance) { - this.availableBalance = availableBalance; - } - - public String getReservedBalance() { - return reservedBalance; - } - - public void setReservedBalance(String reservedBalance) { - this.reservedBalance = reservedBalance; - } - - public String getUnclearedBalance() { - return unclearedBalance; - } - - public void setUnclearedBalance(String unclearedBalance) { - this.unclearedBalance = unclearedBalance; - } - - public String getCurrency() { - return currency; - } - - public void setCurrency(String currency) { - this.currency = currency; - } - - public String getAccountStatus() { - return accountStatus; - } - - public void setAccountStatus(String accountStatus) { - this.accountStatus = accountStatus; - } - - @Override - public String toString() { - return "AccountBalanceResponseDTO{" + - "currentBalance='" + currentBalance + '\'' + - ", availableBalance='" + availableBalance + '\'' + - ", reservedBalance='" + reservedBalance + '\'' + - ", unclearedBalance='" + unclearedBalance + '\'' + - ", currency='" + currency + '\'' + - ", accountStatus='" + accountStatus + '\'' + - '}'; - } } diff --git a/src/main/java/org/mifos/connector/common/gsma/dto/AccountNameResponseDTO.java b/src/main/java/org/mifos/connector/common/gsma/dto/AccountNameResponseDTO.java index f63a4f6..c55c1d1 100644 --- a/src/main/java/org/mifos/connector/common/gsma/dto/AccountNameResponseDTO.java +++ b/src/main/java/org/mifos/connector/common/gsma/dto/AccountNameResponseDTO.java @@ -1,14 +1,12 @@ package org.mifos.connector.common.gsma.dto; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter public class AccountNameResponseDTO { private Name name; - public Name getName() { - return name; - } - - public void setName(Name name) { - this.name = name; - } } diff --git a/src/main/java/org/mifos/connector/common/gsma/dto/AccountStatus.java b/src/main/java/org/mifos/connector/common/gsma/dto/AccountStatus.java index bba167d..3196354 100644 --- a/src/main/java/org/mifos/connector/common/gsma/dto/AccountStatus.java +++ b/src/main/java/org/mifos/connector/common/gsma/dto/AccountStatus.java @@ -19,33 +19,15 @@ } */ //Refactor to use interoperability APIs instead. + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter public class AccountStatus { String status; String subStatus; String lei; - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getSubStatus() { - return subStatus; - } - - public void setSubStatus(String subStatus) { - this.subStatus = subStatus; - } - - public String getLei() { - return lei; - } - - public void setLei(String lei) { - this.lei = lei; - } } \ No newline at end of file diff --git a/src/main/java/org/mifos/connector/common/gsma/dto/AccountStatusRequest.java b/src/main/java/org/mifos/connector/common/gsma/dto/AccountStatusRequest.java index 3b97ef4..9424b8d 100644 --- a/src/main/java/org/mifos/connector/common/gsma/dto/AccountStatusRequest.java +++ b/src/main/java/org/mifos/connector/common/gsma/dto/AccountStatusRequest.java @@ -1,22 +1,12 @@ package org.mifos.connector.common.gsma.dto; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter public class AccountStatusRequest { public String identifierType; public String identifier; - public String getIdentifierType() { - return identifierType; - } - - public void setIdentifierType(String identifierType) { - this.identifierType = identifierType; - } - - public String getIdentifier() { - return identifier; - } - - public void setIdentifier(String identifier) { - this.identifier = identifier; - } } diff --git a/src/main/java/org/mifos/connector/common/gsma/dto/AccountStatusResponseDTO.java b/src/main/java/org/mifos/connector/common/gsma/dto/AccountStatusResponseDTO.java index e8eda00..4a49b64 100644 --- a/src/main/java/org/mifos/connector/common/gsma/dto/AccountStatusResponseDTO.java +++ b/src/main/java/org/mifos/connector/common/gsma/dto/AccountStatusResponseDTO.java @@ -1,14 +1,11 @@ package org.mifos.connector.common.gsma.dto; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter public class AccountStatusResponseDTO { public String accountStatus; - - public String getAccountStatus() { - return accountStatus; - } - - public void setAccountStatus(String accountStatus) { - this.accountStatus = accountStatus; - } } diff --git a/src/main/java/org/mifos/connector/common/gsma/dto/AuthErrorDTO.java b/src/main/java/org/mifos/connector/common/gsma/dto/AuthErrorDTO.java index 9864d79..894c47b 100644 --- a/src/main/java/org/mifos/connector/common/gsma/dto/AuthErrorDTO.java +++ b/src/main/java/org/mifos/connector/common/gsma/dto/AuthErrorDTO.java @@ -1,32 +1,16 @@ package org.mifos.connector.common.gsma.dto; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor public class AuthErrorDTO { private String errorCode; private String errorMessage; - - public AuthErrorDTO(){ - - } - - public AuthErrorDTO(String errorCode, String errorMessage) { - this.errorCode = errorCode; - this.errorMessage = errorMessage; - } - - public String getErrorCode() { - return errorCode; - } - - public void setErrorCode(String errorCode) { - this.errorCode = errorCode; - } - - public String getErrorMessage() { - return errorMessage; - } - - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } } diff --git a/src/main/java/org/mifos/connector/common/gsma/dto/AuthorizationCodeDTO.java b/src/main/java/org/mifos/connector/common/gsma/dto/AuthorizationCodeDTO.java index 282bbaf..366edf2 100644 --- a/src/main/java/org/mifos/connector/common/gsma/dto/AuthorizationCodeDTO.java +++ b/src/main/java/org/mifos/connector/common/gsma/dto/AuthorizationCodeDTO.java @@ -1,7 +1,14 @@ package org.mifos.connector.common.gsma.dto; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + import java.util.Arrays; +@Getter +@Setter +@ToString public class AuthorizationCodeDTO { private String authorisationCode; @@ -17,118 +24,4 @@ public class AuthorizationCodeDTO { private RedemptionTransactionType[] redemptionTransactionTypes; private GsmaParty[] redemptionAccountIdentifiers; private GsmaParty[] metadata; - - public String getAuthorisationCode() { - return authorisationCode; - } - - public void setAuthorisationCode(String authorisationCode) { - this.authorisationCode = authorisationCode; - } - - public String getCodeState() { - return codeState; - } - - public void setCodeState(String codeState) { - this.codeState = codeState; - } - - public String getCodeLifetime() { - return codeLifetime; - } - - public void setCodeLifetime(String codeLifetime) { - this.codeLifetime = codeLifetime; - } - - public String getRequestDate() { - return requestDate; - } - - public void setRequestDate(String requestDate) { - this.requestDate = requestDate; - } - - public String getAmount() { - return amount; - } - - public void setAmount(String amount) { - this.amount = amount; - } - - public String getCurrency() { - return currency; - } - - public void setCurrency(String currency) { - this.currency = currency; - } - - public String getAmountType() { - return amountType; - } - - public void setAmountType(String amountType) { - this.amountType = amountType; - } - - public String getHoldFundsIndicator() { - return holdFundsIndicator; - } - - public void setHoldFundsIndicator(String holdFundsIndicator) { - this.holdFundsIndicator = holdFundsIndicator; - } - - public RedemptionChannel[] getRedemptionChannels() { - return redemptionChannels; - } - - public void setRedemptionChannels(RedemptionChannel[] redemptionChannels) { - this.redemptionChannels = redemptionChannels; - } - - public RedemptionTransactionType[] getRedemptionTransactionTypes() { - return redemptionTransactionTypes; - } - - public void setRedemptionTransactionTypes(RedemptionTransactionType[] redemptionTransactionTypes) { - this.redemptionTransactionTypes = redemptionTransactionTypes; - } - - public GsmaParty[] getRedemptionAccountIdentifiers() { - return redemptionAccountIdentifiers; - } - - public void setRedemptionAccountIdentifiers(GsmaParty[] redemptionAccountIdentifiers) { - this.redemptionAccountIdentifiers = redemptionAccountIdentifiers; - } - - public GsmaParty[] getMetadata() { - return metadata; - } - - public void setMetadata(GsmaParty[] metadata) { - this.metadata = metadata; - } - - @Override - public String toString() { - return "AuthorizationCodeDTO{" + - "authorisationCode='" + authorisationCode + '\'' + - ", codeState='" + codeState + '\'' + - ", codeLifetime='" + codeLifetime + '\'' + - ", requestDate='" + requestDate + '\'' + - ", amount='" + amount + '\'' + - ", currency='" + currency + '\'' + - ", amountType='" + amountType + '\'' + - ", holdFundsIndicator='" + holdFundsIndicator + '\'' + - ", redemptionChannels=" + Arrays.toString(redemptionChannels) + - ", redemptionTransactionTypes=" + Arrays.toString(redemptionTransactionTypes) + - ", redemptionAccountIdentifiers=" + Arrays.toString(redemptionAccountIdentifiers) + - ", metadata=" + Arrays.toString(metadata) + - '}'; - } } diff --git a/src/main/java/org/mifos/connector/common/gsma/dto/Bill.java b/src/main/java/org/mifos/connector/common/gsma/dto/Bill.java index 321feff..f676396 100644 --- a/src/main/java/org/mifos/connector/common/gsma/dto/Bill.java +++ b/src/main/java/org/mifos/connector/common/gsma/dto/Bill.java @@ -1,5 +1,10 @@ package org.mifos.connector.common.gsma.dto; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter public class Bill { private String currency; @@ -7,44 +12,4 @@ public class Bill { private String dueDate; private String billReference; private String minimumAmountDue; - - public String getCurrency() { - return currency; - } - - public void setCurrency(String currency) { - this.currency = currency; - } - - public String getAmountDue() { - return amountDue; - } - - public void setAmountDue(String amountDue) { - this.amountDue = amountDue; - } - - public String getDueDate() { - return dueDate; - } - - public void setDueDate(String dueDate) { - this.dueDate = dueDate; - } - - public String getBillReference() { - return billReference; - } - - public void setBillReference(String billReference) { - this.billReference = billReference; - } - - public String getMinimumAmountDue() { - return minimumAmountDue; - } - - public void setMinimumAmountDue(String minimumAmountDue) { - this.minimumAmountDue = minimumAmountDue; - } } diff --git a/src/main/java/org/mifos/connector/common/gsma/dto/Name.java b/src/main/java/org/mifos/connector/common/gsma/dto/Name.java index 2ad79e8..6ef18db 100644 --- a/src/main/java/org/mifos/connector/common/gsma/dto/Name.java +++ b/src/main/java/org/mifos/connector/common/gsma/dto/Name.java @@ -1,5 +1,14 @@ package org.mifos.connector.common.gsma.dto; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +@Getter +@Setter +@NoArgsConstructor +@ToString public class Name { private String title; @@ -8,64 +17,4 @@ public class Name { private String lastName; private String fullName; private String nativeName; - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getMiddleName() { - return middleName; - } - - public void setMiddleName(String middleName) { - this.middleName = middleName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getFullName() { - return fullName; - } - - public void setFullName(String fullName) { - this.fullName = fullName; - } - - public String getNativeName() { - return nativeName; - } - - public void setNativeName(String nativeName) { - this.nativeName = nativeName; - } - - @Override - public String toString() { - return "Name{" + - "title='" + title + '\'' + - ", firstName='" + firstName + '\'' + - ", middleName='" + middleName + '\'' + - ", lastName='" + lastName + '\'' + - ", fullName='" + fullName + '\'' + - ", nativeName='" + nativeName + '\'' + - '}'; - } } From 9b04261ef714c4adaf5f5032b602deb697ed5cf9 Mon Sep 17 00:00:00 2001 From: kkholmatov Date: Sun, 2 Apr 2023 10:54:46 +0500 Subject: [PATCH 2/2] Removed unnecessary import --- .../mifos/connector/common/gsma/dto/AuthorizationCodeDTO.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/org/mifos/connector/common/gsma/dto/AuthorizationCodeDTO.java b/src/main/java/org/mifos/connector/common/gsma/dto/AuthorizationCodeDTO.java index 366edf2..f743b60 100644 --- a/src/main/java/org/mifos/connector/common/gsma/dto/AuthorizationCodeDTO.java +++ b/src/main/java/org/mifos/connector/common/gsma/dto/AuthorizationCodeDTO.java @@ -4,8 +4,6 @@ import lombok.Setter; import lombok.ToString; -import java.util.Arrays; - @Getter @Setter @ToString