[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: improve use of smart cast
From: |
gnunet |
Subject: |
[libeufin] branch master updated: improve use of smart cast |
Date: |
Mon, 17 Feb 2020 17:43:03 +0100 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new 0a44db6 improve use of smart cast
0a44db6 is described below
commit 0a44db6147a3041de0039c48b85f865b8b1b26e2
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon Feb 17 17:42:58 2020 +0100
improve use of smart cast
---
nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index 94b13dd..152cab6 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -967,22 +967,14 @@ fun main() {
EbicsAccountInfoEntity.new(id = it.id) {
this.subscriber =
getSubscriberEntityFromId(customerIdAtNexus)
accountHolder = it.accountHolder
- iban = when (it.accountNumberList?.get(0))
{
- is EbicsTypes.GeneralAccountNumber -> {
- (it.accountNumberList?.get(0) as
EbicsTypes.GeneralAccountNumber).value
- }
- is EbicsTypes.NationalAccountNumber ->
{
- (it.accountNumberList?.get(0) as
EbicsTypes.NationalAccountNumber).value
- }
+ iban = when (val firstAccount =
it.accountNumberList?.get(0)) {
+ is EbicsTypes.GeneralAccountNumber ->
firstAccount.value
+ is EbicsTypes.NationalAccountNumber ->
firstAccount.value
else -> throw
UnknownBankAccountType(HttpStatusCode.NotFound)
}
- bankCode = when (it.bankCodeList?.get(0)) {
- is EbicsTypes.GeneralBankCode -> {
- (it.bankCodeList?.get(0) as
EbicsTypes.GeneralBankCode).value
- }
- is EbicsTypes.NationalBankCode -> {
- (it.bankCodeList?.get(0) as
EbicsTypes.GeneralBankCode).value
- }
+ bankCode = when (val firstBankCode =
it.bankCodeList?.get(0)) {
+ is EbicsTypes.GeneralBankCode ->
firstBankCode.value
+ is EbicsTypes.NationalBankCode ->
firstBankCode.value
else -> throw
UnknownBankAccountType(HttpStatusCode.NotFound)
}
}
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: improve use of smart cast,
gnunet <=