Skip to content

Commit 6a983f8

Browse files
authored
Merge pull request #150 from Adyen/DefaultPaymentMethodDetail_improvement_PW-881
[PW-881]: Added equals and hashcode methods
2 parents 743a0b7 + 2826d46 commit 6a983f8

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

src/main/java/com/adyen/model/checkout/DefaultPaymentMethodDetails.java

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
package com.adyen.model.checkout;
2323

24+
import java.util.Objects;
2425
import com.adyen.model.Address;
2526
import com.google.gson.annotations.SerializedName;
2627

@@ -283,6 +284,57 @@ public DefaultPaymentMethodDetails idealIssuer(String idealIssuer) {
283284
return this;
284285
}
285286

287+
@Override
288+
public boolean equals(Object o) {
289+
if (this == o) {
290+
return true;
291+
}
292+
if (o == null || getClass() != o.getClass()) {
293+
return false;
294+
}
295+
DefaultPaymentMethodDetails that = (DefaultPaymentMethodDetails) o;
296+
return Objects.equals(type, that.type)
297+
&& Objects.equals(number, that.number)
298+
&& Objects.equals(expiryMonth, that.expiryMonth)
299+
&& Objects.equals(expiryYear, that.expiryYear)
300+
&& Objects.equals(holderName,
301+
that.holderName)
302+
&& Objects.equals(cvc, that.cvc)
303+
&& Objects.equals(installmentConfigurationKey, that.installmentConfigurationKey)
304+
&& Objects.equals(personalDetails,
305+
that.personalDetails)
306+
&& Objects.equals(billingAddress, that.billingAddress)
307+
&& Objects.equals(deliveryAddress, that.deliveryAddress)
308+
&& Objects.equals(encryptedCardNumber, that.encryptedCardNumber)
309+
&& Objects.equals(encryptedExpiryMonth, that.encryptedExpiryMonth)
310+
&& Objects.equals(encryptedExpiryYear, that.encryptedExpiryYear)
311+
&& Objects.equals(encryptedSecurityCode, that.encryptedSecurityCode)
312+
&& Objects.equals(recurringDetailReference, that.recurringDetailReference)
313+
&& Objects.equals(storeDetails, that.storeDetails)
314+
&& Objects.equals(idealIssuer, that.idealIssuer);
315+
}
316+
317+
@Override
318+
public int hashCode() {
319+
return Objects.hash(type,
320+
number,
321+
expiryMonth,
322+
expiryYear,
323+
holderName,
324+
cvc,
325+
installmentConfigurationKey,
326+
personalDetails,
327+
billingAddress,
328+
deliveryAddress,
329+
encryptedCardNumber,
330+
encryptedExpiryMonth,
331+
encryptedExpiryYear,
332+
encryptedSecurityCode,
333+
recurringDetailReference,
334+
storeDetails,
335+
idealIssuer);
336+
}
337+
286338
@Override
287339
public String toString() {
288340
return "DefaultPaymentMethodDetails{"

0 commit comments

Comments
 (0)