Add accessors for HolderName.

This commit is contained in:
yonson2023 2023-12-11 10:57:10 -06:00
parent 3f8fedd618
commit 5e0803a392
No known key found for this signature in database
GPG Key ID: 653F31AF4087E2F2
2 changed files with 18 additions and 0 deletions

View File

@ -209,6 +209,14 @@ public abstract class PaymentAccount implements PersistablePayload {
return Utilities.bytesAsHexString(getSalt());
}
public void setHolderName(String value) {
paymentAccountPayload.setHolderName(value);
}
public String getHolderName() {
return paymentAccountPayload.getHolderName();
}
public String getOwnerId() {
return paymentAccountPayload.getOwnerId();
}

View File

@ -23,6 +23,8 @@ import bisq.common.proto.network.NetworkPayload;
import bisq.common.util.JsonExclude;
import bisq.common.util.Utilities;
import com.google.common.base.Strings;
import org.apache.commons.lang3.ArrayUtils;
import java.nio.charset.StandardCharsets;
@ -129,6 +131,14 @@ public abstract class PaymentAccountPayload implements NetworkPayload, UsedForTr
excludeFromJsonDataMap.put(SALT, Utilities.encodeToHex(salt));
}
public String getHolderName() {
return excludeFromJsonDataMap.getOrDefault(HOLDER_NAME, "");
}
public void setHolderName(String holderName) {
excludeFromJsonDataMap.compute(HOLDER_NAME, (k, v) -> Strings.emptyToNull(holderName));
}
// Identifying data of payment account (e.g. IBAN).
// This is critical code for verifying age of payment account.
// Any change would break validation of historical data!