Moved all extensions to package 'extensions' and grouped them by class
This commit is contained in:
parent
fe69174db9
commit
9746e419d1
|
@ -4,14 +4,13 @@ import net.dankito.banking.fints.messages.MessageBuilder
|
|||
import net.dankito.banking.fints.messages.MessageBuilderResult
|
||||
import net.dankito.banking.fints.model.*
|
||||
import net.dankito.banking.fints.response.BankResponse
|
||||
import net.dankito.banking.fints.response.ResponseParser
|
||||
import net.dankito.banking.fints.response.segments.TanResponse
|
||||
import net.dankito.banking.fints.util.IBase64Service
|
||||
import net.dankito.banking.fints.util.PureKotlinBase64Service
|
||||
import net.dankito.banking.fints.webclient.IWebClient
|
||||
import net.dankito.banking.fints.webclient.KtorWebClient
|
||||
import net.dankito.banking.fints.webclient.WebClientResponse
|
||||
import net.dankito.utils.multiplatform.getAllExceptionMessagesJoined
|
||||
import net.dankito.utils.multiplatform.extensions.getAllExceptionMessagesJoined
|
||||
import net.dankito.utils.multiplatform.log.LoggerFactory
|
||||
|
||||
|
||||
|
|
|
@ -5,10 +5,9 @@ import net.dankito.banking.fints.model.MessageLogEntry
|
|||
import net.dankito.banking.fints.model.MessageLogEntryType
|
||||
import net.dankito.utils.multiplatform.log.Logger
|
||||
import net.dankito.utils.multiplatform.log.LoggerFactory
|
||||
import net.dankito.utils.multiplatform.Date
|
||||
import net.dankito.utils.multiplatform.StackTraceHelper
|
||||
import net.dankito.utils.multiplatform.StringHelper
|
||||
import net.dankito.utils.multiplatform.getInnerException
|
||||
import net.dankito.utils.multiplatform.extensions.format
|
||||
import net.dankito.utils.multiplatform.extensions.getInnerException
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
|
||||
|
@ -81,7 +80,7 @@ open class MessageLogCollector {
|
|||
}
|
||||
|
||||
protected open fun twoDigits(number: Int): String {
|
||||
return StringHelper.format("%02d", number)
|
||||
return number.format("%02d")
|
||||
}
|
||||
|
||||
protected open fun getMessageTypeString(type: MessageLogEntryType): String {
|
||||
|
|
|
@ -21,7 +21,7 @@ import net.dankito.banking.fints.model.Money
|
|||
import net.dankito.banking.fints.response.segments.*
|
||||
import net.dankito.banking.fints.util.MessageUtils
|
||||
import net.dankito.utils.multiplatform.Date
|
||||
import net.dankito.utils.multiplatform.getAllExceptionMessagesJoined
|
||||
import net.dankito.utils.multiplatform.extensions.getAllExceptionMessagesJoined
|
||||
import net.dankito.utils.multiplatform.log.LoggerFactory
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import net.dankito.banking.fints.transactions.mt940.model.*
|
|||
import net.dankito.utils.multiplatform.Date
|
||||
import net.dankito.utils.multiplatform.DateFormatter
|
||||
import net.dankito.utils.multiplatform.Month
|
||||
import net.dankito.utils.multiplatform.isUpperCase
|
||||
import net.dankito.utils.multiplatform.extensions.isUpperCase
|
||||
import net.dankito.utils.multiplatform.log.LoggerFactory
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
package net.dankito.utils.multiplatform
|
||||
|
||||
|
||||
|
||||
fun Date.isBefore(other: Date): Boolean {
|
||||
return compareTo(other) < 0
|
||||
}
|
||||
|
||||
fun Date.isBeforeOrEquals(other: Date): Boolean {
|
||||
return compareTo(other) <= 0
|
||||
}
|
||||
|
||||
|
||||
fun Date.format(format: DateFormatter): String {
|
||||
return format.format(this)
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package net.dankito.utils.multiplatform.extensions
|
||||
|
||||
|
||||
val Char.isLowerCase: Boolean
|
||||
get() = lowercaseChar() == this
|
||||
|
||||
val Char.isUpperCase: Boolean
|
||||
get() = isLowerCase == false
|
||||
|
||||
|
||||
fun CharArray.asString(): String {
|
||||
return this.joinToString("")
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package net.dankito.utils.multiplatform.extensions
|
||||
|
||||
import net.dankito.utils.multiplatform.StringHelper
|
||||
|
||||
|
||||
fun Int.format(format: String): String {
|
||||
return StringHelper.format(format, this)
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package net.dankito.utils.multiplatform.extensions
|
||||
|
||||
import net.dankito.utils.multiplatform.StringHelper
|
||||
|
||||
|
||||
fun String.format(vararg args: Any?): String {
|
||||
return StringHelper.format(this, args)
|
||||
}
|
|
@ -1,25 +1,4 @@
|
|||
package net.dankito.utils.multiplatform
|
||||
|
||||
|
||||
val Char.isLowerCase: Boolean
|
||||
get() = lowercaseChar() == this
|
||||
|
||||
val Char.isUpperCase: Boolean
|
||||
get() = isLowerCase == false
|
||||
|
||||
|
||||
fun CharArray.asString(): String {
|
||||
return this.joinToString("")
|
||||
}
|
||||
|
||||
|
||||
fun Date.isBefore(other: Date): Boolean {
|
||||
return compareTo(other) < 0
|
||||
}
|
||||
|
||||
fun Date.isBeforeOrEquals(other: Date): Boolean {
|
||||
return compareTo(other) <= 0
|
||||
}
|
||||
package net.dankito.utils.multiplatform.extensions
|
||||
|
||||
|
||||
fun Throwable.getAllExceptionMessagesJoined(maxDepth: Int = 5): String {
|
Loading…
Reference in New Issue