change data type of maxTradePeriod to long

This commit is contained in:
Manfred Karrer 2016-04-04 12:58:21 +02:00
parent ed4d643fab
commit 86405a4b88
14 changed files with 16 additions and 21 deletions

View file

@ -25,7 +25,7 @@ public final class AliPayAccountContractData extends PaymentAccountContractData
private String accountNr; private String accountNr;
public AliPayAccountContractData(String paymentMethod, String id, int maxTradePeriod) { public AliPayAccountContractData(String paymentMethod, String id, long maxTradePeriod) {
super(paymentMethod, id, maxTradePeriod); super(paymentMethod, id, maxTradePeriod);
} }

View file

@ -40,7 +40,7 @@ public abstract class BankAccountContractData extends CountryBasedPaymentAccount
@Nullable @Nullable
protected String holderTaxId; protected String holderTaxId;
public BankAccountContractData(String paymentMethod, String id, int maxTradePeriod) { public BankAccountContractData(String paymentMethod, String id, long maxTradePeriod) {
super(paymentMethod, id, maxTradePeriod); super(paymentMethod, id, maxTradePeriod);
} }

View file

@ -34,7 +34,7 @@ public abstract class CountryBasedPaymentAccountContractData extends PaymentAcco
// Constructor // Constructor
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
CountryBasedPaymentAccountContractData(String paymentMethodName, String id, int maxTradePeriod) { CountryBasedPaymentAccountContractData(String paymentMethodName, String id, long maxTradePeriod) {
super(paymentMethodName, id, maxTradePeriod); super(paymentMethodName, id, maxTradePeriod);
} }

View file

@ -31,7 +31,7 @@ public final class CryptoCurrencyAccountContractData extends PaymentAccountContr
@Nullable @Nullable
private String paymentId; private String paymentId;
public CryptoCurrencyAccountContractData(String paymentMethod, String id, int maxTradePeriod) { public CryptoCurrencyAccountContractData(String paymentMethod, String id, long maxTradePeriod) {
super(paymentMethod, id, maxTradePeriod); super(paymentMethod, id, maxTradePeriod);
} }

View file

@ -27,7 +27,7 @@ public final class NationalBankAccountContractData extends BankAccountContractDa
private static final Logger log = LoggerFactory.getLogger(NationalBankAccountContractData.class); private static final Logger log = LoggerFactory.getLogger(NationalBankAccountContractData.class);
public NationalBankAccountContractData(String paymentMethod, String id, int maxTradePeriod) { public NationalBankAccountContractData(String paymentMethod, String id, long maxTradePeriod) {
super(paymentMethod, id, maxTradePeriod); super(paymentMethod, id, maxTradePeriod);
} }

View file

@ -25,7 +25,7 @@ public final class OKPayAccountContractData extends PaymentAccountContractData {
private String accountNr; private String accountNr;
public OKPayAccountContractData(String paymentMethod, String id, int maxTradePeriod) { public OKPayAccountContractData(String paymentMethod, String id, long maxTradePeriod) {
super(paymentMethod, id, maxTradePeriod); super(paymentMethod, id, maxTradePeriod);
} }

View file

@ -135,10 +135,6 @@ public abstract class PaymentAccount implements Persistable {
return contractData.getPaymentDetails(); return contractData.getPaymentDetails();
} }
public int getMaxTradePeriod() {
return contractData.getMaxTradePeriod();
}
public Date getCreationDate() { public Date getCreationDate() {
return creationDate; return creationDate;
} }

View file

@ -26,14 +26,14 @@ public abstract class PaymentAccountContractData implements Payload {
protected final String paymentMethodName; protected final String paymentMethodName;
protected final String id; protected final String id;
protected final int maxTradePeriod; protected final long maxTradePeriod;
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Constructor // Constructor
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
PaymentAccountContractData(String paymentMethodName, String id, int maxTradePeriod) { PaymentAccountContractData(String paymentMethodName, String id, long maxTradePeriod) {
this.paymentMethodName = paymentMethodName; this.paymentMethodName = paymentMethodName;
this.id = id; this.id = id;
this.maxTradePeriod = maxTradePeriod; this.maxTradePeriod = maxTradePeriod;
@ -55,11 +55,10 @@ public abstract class PaymentAccountContractData implements Payload {
abstract public String getPaymentDetailsForTradePopup(); abstract public String getPaymentDetailsForTradePopup();
public int getMaxTradePeriod() { public long getMaxTradePeriod() {
return maxTradePeriod; return maxTradePeriod;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
@ -78,7 +77,7 @@ public abstract class PaymentAccountContractData implements Payload {
public int hashCode() { public int hashCode() {
int result = paymentMethodName != null ? paymentMethodName.hashCode() : 0; int result = paymentMethodName != null ? paymentMethodName.hashCode() : 0;
result = 31 * result + (id != null ? id.hashCode() : 0); result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + maxTradePeriod; result = 31 * result + (int) (maxTradePeriod ^ (maxTradePeriod >>> 32));
return result; return result;
} }

View file

@ -25,7 +25,7 @@ public final class PerfectMoneyAccountContractData extends PaymentAccountContrac
private String accountNr; private String accountNr;
public PerfectMoneyAccountContractData(String paymentMethod, String id, int maxTradePeriod) { public PerfectMoneyAccountContractData(String paymentMethod, String id, long maxTradePeriod) {
super(paymentMethod, id, maxTradePeriod); super(paymentMethod, id, maxTradePeriod);
} }

View file

@ -28,7 +28,7 @@ public final class SameBankAccountContractData extends BankAccountContractData {
private static final Logger log = LoggerFactory.getLogger(SameBankAccountContractData.class); private static final Logger log = LoggerFactory.getLogger(SameBankAccountContractData.class);
public SameBankAccountContractData(String paymentMethod, String id, int maxTradePeriod) { public SameBankAccountContractData(String paymentMethod, String id, long maxTradePeriod) {
super(paymentMethod, id, maxTradePeriod); super(paymentMethod, id, maxTradePeriod);
} }

View file

@ -40,7 +40,7 @@ public final class SepaAccountContractData extends CountryBasedPaymentAccountCon
// Dont use a set here as we need a deterministic ordering, otherwise the contract hash does not match // Dont use a set here as we need a deterministic ordering, otherwise the contract hash does not match
private final ArrayList<String> acceptedCountryCodes; private final ArrayList<String> acceptedCountryCodes;
public SepaAccountContractData(String paymentMethod, String id, int maxTradePeriod) { public SepaAccountContractData(String paymentMethod, String id, long maxTradePeriod) {
super(paymentMethod, id, maxTradePeriod); super(paymentMethod, id, maxTradePeriod);
Set<String> acceptedCountryCodesAsSet = CountryUtil.getAllSepaCountries().stream().map(e -> e.code).collect(Collectors.toSet()); Set<String> acceptedCountryCodesAsSet = CountryUtil.getAllSepaCountries().stream().map(e -> e.code).collect(Collectors.toSet());
acceptedCountryCodes = new ArrayList<>(acceptedCountryCodesAsSet); acceptedCountryCodes = new ArrayList<>(acceptedCountryCodesAsSet);

View file

@ -36,7 +36,7 @@ public final class SpecificBanksAccountContractData extends BankAccountContractD
// Dont use a set here as we need a deterministic ordering, otherwise the contract hash does not match // Dont use a set here as we need a deterministic ordering, otherwise the contract hash does not match
private ArrayList<String> acceptedBanks; private ArrayList<String> acceptedBanks;
public SpecificBanksAccountContractData(String paymentMethod, String id, int maxTradePeriod) { public SpecificBanksAccountContractData(String paymentMethod, String id, long maxTradePeriod) {
super(paymentMethod, id, maxTradePeriod); super(paymentMethod, id, maxTradePeriod);
acceptedBanks = new ArrayList<>(); acceptedBanks = new ArrayList<>();
} }

View file

@ -26,7 +26,7 @@ public final class SwishAccountContractData extends PaymentAccountContractData {
private String mobileNr; private String mobileNr;
private String holderName; private String holderName;
public SwishAccountContractData(String paymentMethod, String id, int maxTradePeriod) { public SwishAccountContractData(String paymentMethod, String id, long maxTradePeriod) {
super(paymentMethod, id, maxTradePeriod); super(paymentMethod, id, maxTradePeriod);
} }

View file

@ -108,7 +108,7 @@ public abstract class PaymentMethodForm {
public static void addAllowedPeriod(GridPane gridPane, int gridRow, public static void addAllowedPeriod(GridPane gridPane, int gridRow,
@Nullable PaymentAccountContractData paymentAccountContractData, String dateFromBlocks) { @Nullable PaymentAccountContractData paymentAccountContractData, String dateFromBlocks) {
if (paymentAccountContractData != null) { if (paymentAccountContractData != null) {
long hours = paymentAccountContractData.getMaxTradePeriod() / 6; long hours = paymentAccountContractData.getMaxTradePeriod() / 3600;
String displayText; String displayText;
if (hours == 1) if (hours == 1)
displayText = hours + " hour"; displayText = hours + " hour";