From 2070eb5dcdbcf56c7b6877f2044a2b7de3866448 Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 22 Apr 2020 20:46:03 +0200 Subject: [PATCH] Using now extension methods from JavaUtils --- .../fints/extensions/CollectionExtensions.kt | 12 ------------ .../fints/extensions/StringExtensions.kt | 17 ----------------- .../dankito/fints/messages/MessageBuilder.kt | 2 +- .../net/dankito/fints/util/MessageUtils.kt | 2 +- 4 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 fints4javaLib/src/main/kotlin/net/dankito/fints/extensions/CollectionExtensions.kt delete mode 100644 fints4javaLib/src/main/kotlin/net/dankito/fints/extensions/StringExtensions.kt diff --git a/fints4javaLib/src/main/kotlin/net/dankito/fints/extensions/CollectionExtensions.kt b/fints4javaLib/src/main/kotlin/net/dankito/fints/extensions/CollectionExtensions.kt deleted file mode 100644 index 360a6c0f..00000000 --- a/fints4javaLib/src/main/kotlin/net/dankito/fints/extensions/CollectionExtensions.kt +++ /dev/null @@ -1,12 +0,0 @@ -package net.dankito.fints.extensions - - -fun Collection.containsAny(otherCollection: Collection): Boolean { - for (otherItem in otherCollection) { - if (this.contains(otherItem)) { - return true - } - } - - return false -} \ No newline at end of file diff --git a/fints4javaLib/src/main/kotlin/net/dankito/fints/extensions/StringExtensions.kt b/fints4javaLib/src/main/kotlin/net/dankito/fints/extensions/StringExtensions.kt deleted file mode 100644 index 169306d8..00000000 --- a/fints4javaLib/src/main/kotlin/net/dankito/fints/extensions/StringExtensions.kt +++ /dev/null @@ -1,17 +0,0 @@ -package net.dankito.fints.extensions - - -fun String.allIndicesOf(toFind: String): List { - val indices = mutableListOf() - var index = -1 - - do { - index = this.indexOf(toFind, index + 1) - - if (index > -1) { - indices.add(index) - } - } while (index > -1) - - return indices -} \ No newline at end of file diff --git a/fints4javaLib/src/main/kotlin/net/dankito/fints/messages/MessageBuilder.kt b/fints4javaLib/src/main/kotlin/net/dankito/fints/messages/MessageBuilder.kt index 1066fcc4..8c5a47b8 100644 --- a/fints4javaLib/src/main/kotlin/net/dankito/fints/messages/MessageBuilder.kt +++ b/fints4javaLib/src/main/kotlin/net/dankito/fints/messages/MessageBuilder.kt @@ -1,6 +1,5 @@ package net.dankito.fints.messages -import net.dankito.fints.extensions.containsAny import net.dankito.fints.messages.datenelemente.implementierte.Aufsetzpunkt import net.dankito.fints.messages.datenelemente.implementierte.Synchronisierungsmodus import net.dankito.fints.messages.datenelemente.implementierte.tan.TanGeneratorTanMedium @@ -25,6 +24,7 @@ import net.dankito.fints.response.segments.JobParameters import net.dankito.fints.response.segments.SepaAccountInfoParameters import net.dankito.fints.response.segments.TanResponse import net.dankito.fints.util.FinTsUtils +import net.dankito.utils.extensions.containsAny import kotlin.random.Random diff --git a/fints4javaLib/src/main/kotlin/net/dankito/fints/util/MessageUtils.kt b/fints4javaLib/src/main/kotlin/net/dankito/fints/util/MessageUtils.kt index cd7f5f5d..c3a452d6 100644 --- a/fints4javaLib/src/main/kotlin/net/dankito/fints/util/MessageUtils.kt +++ b/fints4javaLib/src/main/kotlin/net/dankito/fints/util/MessageUtils.kt @@ -1,8 +1,8 @@ package net.dankito.fints.util -import net.dankito.fints.extensions.allIndicesOf import net.dankito.fints.messages.Separators import net.dankito.fints.response.ResponseParser +import net.dankito.utils.extensions.allIndicesOf import java.util.regex.Matcher import java.util.regex.Pattern