diff --git a/CHANGELOG.md b/CHANGELOG.md index d9b66bd1..154aeeb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [🐛 v1.5.1 ] - 2022-08-15 +## [🐛 v1.5.1 ] - 2022-08-23 -### 🐛 Fixes - -* Fix min sdk issue +### Fix min sdk issue and some improvements ## [🎉 1.5.0 Structure, Logger, OkHttp] - 2022-08-22 diff --git a/affogato-core-ktx/build.gradle.kts b/affogato-core-ktx/build.gradle.kts index bcd16170..981379fe 100644 --- a/affogato-core-ktx/build.gradle.kts +++ b/affogato-core-ktx/build.gradle.kts @@ -42,10 +42,10 @@ dependencies { afterEvaluate { publishing { publications { - create("java") { + create("release") { groupId = "com.parsuomash.affogato" artifactId = "affogato-core-ktx" - version = "1.5.0" + version = "1.5.1" from(components["java"]) } diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Number.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Number.kt index 1f2d0913..4a612107 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Number.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Number.kt @@ -11,4 +11,6 @@ package com.parsuomash.affogato.core.ktx * @since 1.1.0 * @return [Number] value or **Zero** */ -fun Number?.orZero(): Number = this ?: 0 +@JvmSynthetic +fun Number?.orZero(): Number = + this ?: 0 diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Primitives.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Primitives.kt index abff883f..39b3bf82 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Primitives.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Primitives.kt @@ -1,5 +1,61 @@ package com.parsuomash.affogato.core.ktx +/** + * Checking positivity. + * + * Example: + * ```Kotlin + * 10.isPositive() // true + * -10.isPositive() // false + * ``` + * @since 1.5.1 + */ +@get:JvmSynthetic +inline val Int.isPositive: Boolean + get() = this > 0 + +/** + * Checking positivity. + * + * Example: + * ```Kotlin + * 10L.isPositive() // true + * -10L.isPositive() // false + * ``` + * @since 1.5.1 + */ +@get:JvmSynthetic +inline val Long.isPositive: Boolean + get() = this > 0 + +/** + * Checking positivity. + * + * Example: + * ```Kotlin + * 10F.isPositive() // true + * -10F.isPositive() // false + * ``` + * @since 1.5.1 + */ +@get:JvmSynthetic +inline val Float.isPositive: Boolean + get() = this > 0 + +/** + * Checking positivity. + * + * Example: + * ```Kotlin + * 10.0.isPositive() // true + * -10.0.isPositive() // false + * ``` + * @since 1.5.1 + */ +@get:JvmSynthetic +inline val Double.isPositive: Boolean + get() = this > 0 + /** * Checking negativity. * @@ -10,7 +66,9 @@ package com.parsuomash.affogato.core.ktx * ``` * @since 1.1.0 */ -inline val Int.isNegative: Boolean get() = this < 0 +@get:JvmSynthetic +inline val Int.isNegative: Boolean + get() = this < 0 /** * Checking negativity. @@ -22,7 +80,9 @@ inline val Int.isNegative: Boolean get() = this < 0 * ``` * @since 1.1.0 */ -inline val Long.isNegative: Boolean get() = this < 0 +@get:JvmSynthetic +inline val Long.isNegative: Boolean + get() = this < 0 /** * Checking negativity. @@ -34,7 +94,9 @@ inline val Long.isNegative: Boolean get() = this < 0 * ``` * @since 1.1.0 */ -inline val Float.isNegative: Boolean get() = this < 0 +@get:JvmSynthetic +inline val Float.isNegative: Boolean + get() = this < 0 /** * Checking negativity. @@ -46,7 +108,9 @@ inline val Float.isNegative: Boolean get() = this < 0 * ``` * @since 1.1.0 */ -inline val Double.isNegative: Boolean get() = this < 0 +@get:JvmSynthetic +inline val Double.isNegative: Boolean + get() = this < 0 /** * Return zero when number is null. @@ -59,7 +123,9 @@ inline val Double.isNegative: Boolean get() = this < 0 * @since 1.1.0 * @return [Int] value or **Zero** */ -fun Int?.orZero(): Int = this ?: 0 +@JvmSynthetic +fun Int?.orZero(): Int = + this ?: 0 /** * Return zero when number is null. @@ -72,7 +138,9 @@ fun Int?.orZero(): Int = this ?: 0 * @since 1.1.0 * @return [Long] value or **Zero** */ -fun Long?.orZero(): Long = this ?: 0L +@JvmSynthetic +fun Long?.orZero(): Long = + this ?: 0L /** * Return zero when number is null. @@ -85,7 +153,9 @@ fun Long?.orZero(): Long = this ?: 0L * @since 1.1.0 * @return [Float] value or **Zero** */ -fun Float?.orZero(): Float = this ?: 0F +@JvmSynthetic +fun Float?.orZero(): Float = + this ?: 0F /** * Return zero when number is null. @@ -98,4 +168,6 @@ fun Float?.orZero(): Float = this ?: 0F * @since 1.1.0 * @return [Double] value or **Zero** */ -fun Double?.orZero(): Double = this ?: 0.0 +@JvmSynthetic +fun Double?.orZero(): Double = + this ?: 0.0 diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Scope.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Scope.kt index e08abc0e..d115b7d9 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Scope.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Scope.kt @@ -17,6 +17,7 @@ package com.parsuomash.affogato.core.ktx * @see let * @see also */ +@JvmSynthetic inline fun T.runBlock(block: () -> Unit): T { val old = this block() @@ -51,6 +52,7 @@ inline fun T.runBlock(block: () -> Unit): T { ), level = DeprecationLevel.WARNING ) +@JvmSynthetic inline fun T.block(block: () -> Unit): T { val old = this block() diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Standard.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Standard.kt index f6de9741..b0a06dd3 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Standard.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/Standard.kt @@ -188,6 +188,7 @@ fun counter(content: Iterable): Map = * @since 1.1.0 * @return [T] value or **default** */ +@JvmSynthetic fun T?.orDefault(default: T): T = this ?: default @@ -205,6 +206,7 @@ fun T?.orDefault(default: T): T = * @since 1.1.0 * @return [Boolean] */ +@JvmSynthetic fun T?.isNull(): Boolean = this == null @@ -222,6 +224,7 @@ fun T?.isNull(): Boolean = * @since 1.1.0 * @return [Boolean] */ +@JvmSynthetic fun T?.isNotNull(): Boolean = this != null @@ -247,6 +250,7 @@ fun T?.isNotNull(): Boolean = * @since 1.1.0 * @return value or [Unit] */ +@JvmSynthetic inline fun T?.ifNull(block: (T?) -> Any): Any = this ?: block(this) @@ -272,6 +276,7 @@ inline fun T?.ifNull(block: (T?) -> Any): Any = * @since 1.1.0 * @return value or [Unit] */ +@JvmSynthetic inline fun T?.ifNotNull(block: (T) -> R): R? = if (this != null) block(this) else this diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Array.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Array.kt index 70e57c9c..d64590cb 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Array.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Array.kt @@ -13,6 +13,7 @@ import com.parsuomash.affogato.core.ktx.tryCatchNull * @see asDecimal * @see asReversedDecimal */ +@get:JvmName("asHex") inline val ByteArray.asHex: String get() = joinToString(" ") { "%02X".format(it) } @@ -24,6 +25,7 @@ inline val ByteArray.asHex: String * @see asDecimal * @see asReversedDecimal */ +@get:JvmName("asReversedHex") inline val ByteArray.asReversedHex: String get() = reversedArray().joinToString(" ") { "%02X".format(it) } @@ -35,6 +37,7 @@ inline val ByteArray.asReversedHex: String * @see asReversedHex * @see asReversedDecimal */ +@get:JvmName("asDecimal") inline val ByteArray.asDecimal: String get() = buildString { this@asDecimal.forEach { append("%02X".format(it).toLong(16)) } } @@ -46,6 +49,7 @@ inline val ByteArray.asDecimal: String * @see asReversedHex * @see asDecimal */ +@get:JvmName("asReversedDecimal") inline val ByteArray.asReversedDecimal: String get() = buildString { this@asReversedDecimal.reversedArray().forEach { append("%02X".format(it).toLong(16)) } @@ -63,6 +67,7 @@ inline val ByteArray.asReversedDecimal: String * @see Int * @see IntRange */ +@JvmSynthetic fun arrayOf(range: IntRange): Array = range.toList().toTypedArray() /** @@ -77,6 +82,7 @@ fun arrayOf(range: IntRange): Array = range.toList().toTypedArray() * @see UInt * @see UIntRange */ +@JvmSynthetic fun arrayOf(range: UIntRange): Array = range.toList().toTypedArray() /** @@ -91,6 +97,7 @@ fun arrayOf(range: UIntRange): Array = range.toList().toTypedArray() * @see Long * @see LongRange */ +@JvmSynthetic fun arrayOf(range: LongRange): Array = range.toList().toTypedArray() /** @@ -105,6 +112,7 @@ fun arrayOf(range: LongRange): Array = range.toList().toTypedArray() * @see ULong * @see ULongRange */ +@JvmSynthetic fun arrayOf(range: ULongRange): Array = range.toList().toTypedArray() /** @@ -119,6 +127,7 @@ fun arrayOf(range: ULongRange): Array = range.toList().toTypedArray() * @see Int * @see IntProgression */ +@JvmSynthetic fun arrayOf(progression: IntProgression): Array = progression.toList().toTypedArray() /** @@ -133,6 +142,7 @@ fun arrayOf(progression: IntProgression): Array = progression.toList().toTy * @see UInt * @see UIntProgression */ +@JvmSynthetic fun arrayOf(progression: UIntProgression): Array = progression.toList().toTypedArray() /** @@ -147,6 +157,7 @@ fun arrayOf(progression: UIntProgression): Array = progression.toList().to * @see Long * @see LongProgression */ +@JvmSynthetic fun arrayOf(progression: LongProgression): Array = progression.toList().toTypedArray() /** @@ -161,6 +172,7 @@ fun arrayOf(progression: LongProgression): Array = progression.toList().to * @see ULong * @see ULongProgression */ +@JvmSynthetic fun arrayOf(progression: ULongProgression): Array = progression.toList().toTypedArray() /** @@ -175,6 +187,7 @@ fun arrayOf(progression: ULongProgression): Array = progression.toList(). * @see Char * @see CharRange */ +@JvmSynthetic fun arrayOf(range: CharRange): Array = range.toList().toTypedArray() /** @@ -189,6 +202,7 @@ fun arrayOf(range: CharRange): Array = range.toList().toTypedArray() * @see Char * @see CharProgression */ +@JvmSynthetic fun arrayOf(progression: CharProgression): Array = progression.toList().toTypedArray() /** @@ -202,6 +216,7 @@ fun arrayOf(progression: CharProgression): Array = progression.toList().to * @see IntArray * @see IntRange */ +@JvmSynthetic fun intArrayOf(range: IntRange): IntArray = range.toList().toIntArray() /** @@ -215,6 +230,7 @@ fun intArrayOf(range: IntRange): IntArray = range.toList().toIntArray() * @see IntArray * @see IntProgression */ +@JvmSynthetic fun intArrayOf(progression: IntProgression): IntArray = progression.toList().toIntArray() /** @@ -229,6 +245,7 @@ fun intArrayOf(progression: IntProgression): IntArray = progression.toList().toI * @see UIntRange */ @ExperimentalUnsignedTypes +@JvmSynthetic fun uintArrayOf(range: UIntRange): UIntArray = range.toList().toUIntArray() /** @@ -243,6 +260,7 @@ fun uintArrayOf(range: UIntRange): UIntArray = range.toList().toUIntArray() * @see UIntProgression */ @ExperimentalUnsignedTypes +@JvmSynthetic fun uintArrayOf(progression: UIntProgression): UIntArray = progression.toList().toUIntArray() /** @@ -256,6 +274,7 @@ fun uintArrayOf(progression: UIntProgression): UIntArray = progression.toList(). * @see LongArray * @see LongRange */ +@JvmSynthetic fun longArrayOf(range: LongRange): LongArray = range.toList().toLongArray() /** @@ -269,6 +288,7 @@ fun longArrayOf(range: LongRange): LongArray = range.toList().toLongArray() * @see LongArray * @see LongProgression */ +@JvmSynthetic fun longArrayOf(progression: LongProgression): LongArray = progression.toList().toLongArray() /** @@ -283,6 +303,7 @@ fun longArrayOf(progression: LongProgression): LongArray = progression.toList(). * @see ULongRange */ @ExperimentalUnsignedTypes +@JvmSynthetic fun ulongArrayOf(range: ULongRange): ULongArray = range.toList().toULongArray() /** @@ -297,6 +318,7 @@ fun ulongArrayOf(range: ULongRange): ULongArray = range.toList().toULongArray() * @see ULongProgression */ @ExperimentalUnsignedTypes +@JvmSynthetic fun ulongArrayOf(progression: ULongProgression): ULongArray = progression.toList().toULongArray() /** @@ -310,6 +332,7 @@ fun ulongArrayOf(progression: ULongProgression): ULongArray = progression.toList * @see CharArray * @see CharRange */ +@JvmSynthetic fun charArrayOf(range: CharRange): CharArray = range.toList().toCharArray() /** @@ -323,6 +346,7 @@ fun charArrayOf(range: CharRange): CharArray = range.toList().toCharArray() * @see CharArray * @see CharProgression */ +@JvmSynthetic fun charArrayOf(progression: CharProgression): CharArray = progression.toList().toCharArray() /** @@ -338,6 +362,7 @@ fun charArrayOf(progression: CharProgression): CharArray = progression.toList(). * @since 1.1.0 * @see arrayOf */ +@JvmSynthetic fun Array.getOrEmpty(index: Int): String = if (index in 0..lastIndex) toList()[index] else "" @@ -368,6 +393,7 @@ inline operator fun Array.get(indices: IntRange): Array = slic * @see sliceArray * @see byteArrayOf */ +@JvmSynthetic operator fun ByteArray.get(indices: IntRange): ByteArray = sliceArray(indices) /** @@ -382,6 +408,7 @@ operator fun ByteArray.get(indices: IntRange): ByteArray = sliceArray(indices) * @see sliceArray * @see charArrayOf */ +@JvmSynthetic operator fun CharArray.get(indices: IntRange): CharArray = sliceArray(indices) /** @@ -396,6 +423,7 @@ operator fun CharArray.get(indices: IntRange): CharArray = sliceArray(indices) * @see sliceArray * @see shortArrayOf */ +@JvmSynthetic operator fun ShortArray.get(indices: IntRange): ShortArray = sliceArray(indices) /** @@ -410,6 +438,7 @@ operator fun ShortArray.get(indices: IntRange): ShortArray = sliceArray(indices) * @see sliceArray * @see intArrayOf */ +@JvmSynthetic operator fun IntArray.get(indices: IntRange): IntArray = sliceArray(indices) /** @@ -424,6 +453,7 @@ operator fun IntArray.get(indices: IntRange): IntArray = sliceArray(indices) * @see sliceArray * @see longArrayOf */ +@JvmSynthetic operator fun LongArray.get(indices: IntRange): LongArray = sliceArray(indices) /** @@ -439,6 +469,7 @@ operator fun LongArray.get(indices: IntRange): LongArray = sliceArray(indices) * @see sliceArray * @see floatArrayOf */ +@JvmSynthetic operator fun FloatArray.get(indices: IntRange): FloatArray = sliceArray(indices) /** @@ -454,6 +485,7 @@ operator fun FloatArray.get(indices: IntRange): FloatArray = sliceArray(indices) * @see sliceArray * @see doubleArrayOf */ +@JvmSynthetic operator fun DoubleArray.get(indices: IntRange): DoubleArray = sliceArray(indices) /** @@ -469,6 +501,7 @@ operator fun DoubleArray.get(indices: IntRange): DoubleArray = sliceArray(indice * @see sliceArray * @see booleanArrayOf */ +@JvmSynthetic operator fun BooleanArray.get(indices: IntRange): BooleanArray = sliceArray(indices) /** @@ -499,6 +532,7 @@ inline operator fun Array.get(indices: IntProgression): Array * @see sliceArray * @see byteArrayOf */ +@JvmSynthetic operator fun ByteArray.get(indices: IntProgression): ByteArray = sliceArray(indices.toList()) /** @@ -513,6 +547,7 @@ operator fun ByteArray.get(indices: IntProgression): ByteArray = sliceArray(indi * @see sliceArray * @see charArrayOf */ +@JvmSynthetic operator fun CharArray.get(indices: IntProgression): CharArray = sliceArray(indices.toList()) /** @@ -527,6 +562,7 @@ operator fun CharArray.get(indices: IntProgression): CharArray = sliceArray(indi * @see sliceArray * @see shortArrayOf */ +@JvmSynthetic operator fun ShortArray.get(indices: IntProgression): ShortArray = sliceArray(indices.toList()) /** @@ -541,6 +577,7 @@ operator fun ShortArray.get(indices: IntProgression): ShortArray = sliceArray(in * @see sliceArray * @see intArrayOf */ +@JvmSynthetic operator fun IntArray.get(indices: IntProgression): IntArray = sliceArray(indices.toList()) /** @@ -555,6 +592,7 @@ operator fun IntArray.get(indices: IntProgression): IntArray = sliceArray(indice * @see sliceArray * @see longArrayOf */ +@JvmSynthetic operator fun LongArray.get(indices: IntProgression): LongArray = sliceArray(indices.toList()) /** @@ -570,6 +608,7 @@ operator fun LongArray.get(indices: IntProgression): LongArray = sliceArray(indi * @see sliceArray * @see floatArrayOf */ +@JvmSynthetic operator fun FloatArray.get(indices: IntProgression): FloatArray = sliceArray(indices.toList()) /** @@ -585,6 +624,7 @@ operator fun FloatArray.get(indices: IntProgression): FloatArray = sliceArray(in * @see sliceArray * @see doubleArrayOf */ +@JvmSynthetic operator fun DoubleArray.get(indices: IntProgression): DoubleArray = sliceArray(indices.toList()) /** @@ -599,6 +639,7 @@ operator fun DoubleArray.get(indices: IntProgression): DoubleArray = sliceArray( * @throws IndexOutOfBoundsException if the range is out of bounds of the array. * @see booleanArrayOf */ +@JvmSynthetic operator fun BooleanArray.get(indices: IntProgression): BooleanArray = sliceArray(indices.toList()) /** @@ -629,6 +670,7 @@ inline fun Array.getOrNull(indices: IntRange): Array? = * @see sliceArray * @see byteArrayOf */ +@JvmSynthetic fun ByteArray.getOrNull(indices: IntRange): ByteArray? = tryCatchNull { get(indices) } /** @@ -643,6 +685,7 @@ fun ByteArray.getOrNull(indices: IntRange): ByteArray? = tryCatchNull { get(indi * @see sliceArray * @see charArrayOf */ +@JvmSynthetic fun CharArray.getOrNull(indices: IntRange): CharArray? = tryCatchNull { get(indices) } /** @@ -657,6 +700,7 @@ fun CharArray.getOrNull(indices: IntRange): CharArray? = tryCatchNull { get(indi * @see sliceArray * @see shortArrayOf */ +@JvmSynthetic fun ShortArray.getOrNull(indices: IntRange): ShortArray? = tryCatchNull { get(indices) } /** @@ -671,6 +715,7 @@ fun ShortArray.getOrNull(indices: IntRange): ShortArray? = tryCatchNull { get(in * @see sliceArray * @see intArrayOf */ +@JvmSynthetic fun IntArray.getOrNull(indices: IntRange): IntArray? = tryCatchNull { get(indices) } /** @@ -685,6 +730,7 @@ fun IntArray.getOrNull(indices: IntRange): IntArray? = tryCatchNull { get(indice * @see sliceArray * @see longArrayOf */ +@JvmSynthetic fun LongArray.getOrNull(indices: IntRange): LongArray? = tryCatchNull { get(indices) } /** @@ -701,6 +747,7 @@ fun LongArray.getOrNull(indices: IntRange): LongArray? = tryCatchNull { get(indi * @see sliceArray * @see floatArrayOf */ +@JvmSynthetic fun FloatArray.getOrNull(indices: IntRange): FloatArray? = tryCatchNull { get(indices) } /** @@ -716,6 +763,7 @@ fun FloatArray.getOrNull(indices: IntRange): FloatArray? = tryCatchNull { get(in * @see sliceArray * @see doubleArrayOf */ +@JvmSynthetic fun DoubleArray.getOrNull(indices: IntRange): DoubleArray? = tryCatchNull { get(indices) } /** @@ -732,6 +780,7 @@ fun DoubleArray.getOrNull(indices: IntRange): DoubleArray? = tryCatchNull { get( * @see sliceArray * @see booleanArrayOf */ +@JvmSynthetic fun BooleanArray.getOrNull(indices: IntRange): BooleanArray? = tryCatchNull { get(indices) } /** @@ -762,6 +811,7 @@ inline fun Array.getOrNull(indices: IntProgression): Array? = * @see sliceArray * @see byteArrayOf */ +@JvmSynthetic fun ByteArray.getOrNull(indices: IntProgression): ByteArray? = tryCatchNull { get(indices) } /** @@ -776,6 +826,7 @@ fun ByteArray.getOrNull(indices: IntProgression): ByteArray? = tryCatchNull { ge * @see sliceArray * @see charArrayOf */ +@JvmSynthetic fun CharArray.getOrNull(indices: IntProgression): CharArray? = tryCatchNull { get(indices) } /** @@ -790,6 +841,7 @@ fun CharArray.getOrNull(indices: IntProgression): CharArray? = tryCatchNull { ge * @see sliceArray * @see shortArrayOf */ +@JvmSynthetic fun ShortArray.getOrNull(indices: IntProgression): ShortArray? = tryCatchNull { get(indices) } /** @@ -804,6 +856,7 @@ fun ShortArray.getOrNull(indices: IntProgression): ShortArray? = tryCatchNull { * @see sliceArray * @see intArrayOf */ +@JvmSynthetic fun IntArray.getOrNull(indices: IntProgression): IntArray? = tryCatchNull { get(indices) } /** @@ -818,6 +871,7 @@ fun IntArray.getOrNull(indices: IntProgression): IntArray? = tryCatchNull { get( * @see sliceArray * @see longArrayOf */ +@JvmSynthetic fun LongArray.getOrNull(indices: IntProgression): LongArray? = tryCatchNull { get(indices) } /** @@ -834,6 +888,7 @@ fun LongArray.getOrNull(indices: IntProgression): LongArray? = tryCatchNull { ge * @see sliceArray * @see floatArrayOf */ +@JvmSynthetic fun FloatArray.getOrNull(indices: IntProgression): FloatArray? = tryCatchNull { get(indices) } /** @@ -850,6 +905,7 @@ fun FloatArray.getOrNull(indices: IntProgression): FloatArray? = tryCatchNull { * @see sliceArray * @see doubleArrayOf */ +@JvmSynthetic fun DoubleArray.getOrNull(indices: IntProgression): DoubleArray? = tryCatchNull { get(indices) } /** @@ -866,6 +922,7 @@ fun DoubleArray.getOrNull(indices: IntProgression): DoubleArray? = tryCatchNull * @see sliceArray * @see booleanArrayOf */ +@JvmSynthetic fun BooleanArray.getOrNull(indices: IntProgression): BooleanArray? = tryCatchNull { get(indices) } /** @@ -898,6 +955,7 @@ inline fun Array.getOrElse( * @see sliceArray * @see byteArrayOf */ +@JvmSynthetic inline fun ByteArray.getOrElse( indices: IntRange, defaultValue: () -> ByteArray @@ -915,6 +973,7 @@ inline fun ByteArray.getOrElse( * @see sliceArray * @see charArrayOf */ +@JvmSynthetic inline fun CharArray.getOrElse( indices: IntRange, defaultValue: () -> CharArray @@ -932,6 +991,7 @@ inline fun CharArray.getOrElse( * @see sliceArray * @see shortArrayOf */ +@JvmSynthetic inline fun ShortArray.getOrElse( indices: IntRange, defaultValue: () -> ShortArray @@ -949,6 +1009,7 @@ inline fun ShortArray.getOrElse( * @see sliceArray * @see intArrayOf */ +@JvmSynthetic inline fun IntArray.getOrElse( indices: IntRange, defaultValue: () -> IntArray @@ -966,6 +1027,7 @@ inline fun IntArray.getOrElse( * @see sliceArray * @see longArrayOf */ +@JvmSynthetic inline fun LongArray.getOrElse( indices: IntRange, defaultValue: () -> LongArray @@ -985,6 +1047,7 @@ inline fun LongArray.getOrElse( * @see sliceArray * @see floatArrayOf */ +@JvmSynthetic inline fun FloatArray.getOrElse( indices: IntRange, defaultValue: () -> FloatArray @@ -1004,6 +1067,7 @@ inline fun FloatArray.getOrElse( * @see sliceArray * @see doubleArrayOf */ +@JvmSynthetic inline fun DoubleArray.getOrElse( indices: IntRange, defaultValue: () -> DoubleArray @@ -1023,6 +1087,7 @@ inline fun DoubleArray.getOrElse( * @see sliceArray * @see booleanArrayOf */ +@JvmSynthetic inline fun BooleanArray.getOrElse( indices: IntRange, defaultValue: () -> BooleanArray @@ -1060,6 +1125,7 @@ inline fun Array.getOrElse( * @see sliceArray * @see byteArrayOf */ +@JvmSynthetic inline fun ByteArray.getOrElse( indices: IntProgression, defaultValue: () -> ByteArray @@ -1077,6 +1143,7 @@ inline fun ByteArray.getOrElse( * @see sliceArray * @see charArrayOf */ +@JvmSynthetic inline fun CharArray.getOrElse( indices: IntProgression, defaultValue: () -> CharArray @@ -1096,6 +1163,7 @@ inline fun CharArray.getOrElse( * @see sliceArray * @see shortArrayOf */ +@JvmSynthetic inline fun ShortArray.getOrElse( indices: IntProgression, defaultValue: () -> ShortArray @@ -1113,6 +1181,7 @@ inline fun ShortArray.getOrElse( * @see sliceArray * @see intArrayOf */ +@JvmSynthetic inline fun IntArray.getOrElse( indices: IntProgression, defaultValue: () -> IntArray @@ -1130,6 +1199,7 @@ inline fun IntArray.getOrElse( * @see sliceArray * @see longArrayOf */ +@JvmSynthetic inline fun LongArray.getOrElse( indices: IntProgression, defaultValue: () -> LongArray @@ -1149,6 +1219,7 @@ inline fun LongArray.getOrElse( * @see sliceArray * @see floatArrayOf */ +@JvmSynthetic inline fun FloatArray.getOrElse( indices: IntProgression, defaultValue: () -> FloatArray @@ -1168,6 +1239,7 @@ inline fun FloatArray.getOrElse( * @see sliceArray * @see doubleArrayOf */ +@JvmSynthetic inline fun DoubleArray.getOrElse( indices: IntProgression, defaultValue: () -> DoubleArray @@ -1187,6 +1259,7 @@ inline fun DoubleArray.getOrElse( * @see sliceArray * @see booleanArrayOf */ +@JvmSynthetic inline fun BooleanArray.getOrElse( indices: IntProgression, defaultValue: () -> BooleanArray @@ -1223,6 +1296,7 @@ inline fun Array.head(n: Int = 10): List = take(n) * @see take * @see byteArrayOf */ +@JvmOverloads fun ByteArray.head(n: Int = 10): List = take(n) /** @@ -1239,6 +1313,7 @@ fun ByteArray.head(n: Int = 10): List = take(n) * @see take * @see charArrayOf */ +@JvmOverloads fun CharArray.head(n: Int = 10): List = take(n) /** @@ -1255,6 +1330,7 @@ fun CharArray.head(n: Int = 10): List = take(n) * @see take * @see shortArrayOf */ +@JvmOverloads fun ShortArray.head(n: Int = 10): List = take(n) /** @@ -1271,6 +1347,7 @@ fun ShortArray.head(n: Int = 10): List = take(n) * @see take * @see intArrayOf */ +@JvmOverloads fun IntArray.head(n: Int = 10): List = take(n) /** @@ -1287,6 +1364,7 @@ fun IntArray.head(n: Int = 10): List = take(n) * @see take * @see longArrayOf */ +@JvmOverloads fun LongArray.head(n: Int = 10): List = take(n) /** @@ -1303,6 +1381,7 @@ fun LongArray.head(n: Int = 10): List = take(n) * @see take * @see floatArrayOf */ +@JvmOverloads fun FloatArray.head(n: Int = 10): List = take(n) /** @@ -1319,6 +1398,7 @@ fun FloatArray.head(n: Int = 10): List = take(n) * @see take * @see doubleArrayOf */ +@JvmOverloads fun DoubleArray.head(n: Int = 10): List = take(n) /** @@ -1335,6 +1415,7 @@ fun DoubleArray.head(n: Int = 10): List = take(n) * @see take * @see booleanArrayOf */ +@JvmOverloads fun BooleanArray.head(n: Int = 10): List = take(n) /** @@ -1370,6 +1451,7 @@ inline fun Array.tail(n: Int = 10): List = (size - n).let { * @see drop * @see byteArrayOf */ +@JvmOverloads fun ByteArray.tail(n: Int = 10): List = (size - n).let { drop(if (it < 0) 0 else it) } /** @@ -1386,6 +1468,7 @@ fun ByteArray.tail(n: Int = 10): List = (size - n).let { drop(if (it < 0) * @see drop * @see charArrayOf */ +@JvmOverloads fun CharArray.tail(n: Int = 10): List = (size - n).let { drop(if (it < 0) 0 else it) } /** @@ -1402,6 +1485,7 @@ fun CharArray.tail(n: Int = 10): List = (size - n).let { drop(if (it < 0) * @see drop * @see shortArrayOf */ +@JvmOverloads fun ShortArray.tail(n: Int = 10): List = (size - n).let { drop(if (it < 0) 0 else it) } /** @@ -1418,6 +1502,7 @@ fun ShortArray.tail(n: Int = 10): List = (size - n).let { drop(if (it < 0 * @see drop * @see intArrayOf */ +@JvmOverloads fun IntArray.tail(n: Int = 10): List = (size - n).let { drop(if (it < 0) 0 else it) } /** @@ -1434,6 +1519,7 @@ fun IntArray.tail(n: Int = 10): List = (size - n).let { drop(if (it < 0) 0 * @see drop * @see longArrayOf */ +@JvmOverloads fun LongArray.tail(n: Int = 10): List = (size - n).let { drop(if (it < 0) 0 else it) } /** @@ -1450,6 +1536,7 @@ fun LongArray.tail(n: Int = 10): List = (size - n).let { drop(if (it < 0) * @see drop * @see floatArrayOf */ +@JvmOverloads fun FloatArray.tail(n: Int = 10): List = (size - n).let { drop(if (it < 0) 0 else it) } /** @@ -1466,6 +1553,7 @@ fun FloatArray.tail(n: Int = 10): List = (size - n).let { drop(if (it < 0 * @see drop * @see doubleArrayOf */ +@JvmOverloads fun DoubleArray.tail(n: Int = 10): List = (size - n).let { drop(if (it < 0) 0 else it) } /** @@ -1482,6 +1570,7 @@ fun DoubleArray.tail(n: Int = 10): List = (size - n).let { drop(if (it < * @see drop * @see booleanArrayOf */ +@JvmOverloads fun BooleanArray.tail(n: Int = 10): List = (size - n).let { drop(if (it < 0) 0 else it) } /** @@ -1869,6 +1958,7 @@ inline fun Array.rotateLeft(n: Int = 1): Array { * @see java.util.Collections.rotate * @see byteArrayOf */ +@JvmOverloads fun ByteArray.rotateLeft(n: Int = 1): ByteArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() @@ -1889,6 +1979,7 @@ fun ByteArray.rotateLeft(n: Int = 1): ByteArray { * @see java.util.Collections.rotate * @see shortArrayOf */ +@JvmOverloads fun ShortArray.rotateLeft(n: Int = 1): ShortArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() @@ -1909,6 +2000,7 @@ fun ShortArray.rotateLeft(n: Int = 1): ShortArray { * @see java.util.Collections.rotate * @see charArrayOf */ +@JvmOverloads fun CharArray.rotateLeft(n: Int = 1): CharArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() @@ -1929,6 +2021,7 @@ fun CharArray.rotateLeft(n: Int = 1): CharArray { * @see java.util.Collections.rotate * @see intArrayOf */ +@JvmOverloads fun IntArray.rotateLeft(n: Int = 1): IntArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() @@ -1949,6 +2042,7 @@ fun IntArray.rotateLeft(n: Int = 1): IntArray { * @see java.util.Collections.rotate * @see longArrayOf */ +@JvmOverloads fun LongArray.rotateLeft(n: Int = 1): LongArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() @@ -1969,6 +2063,7 @@ fun LongArray.rotateLeft(n: Int = 1): LongArray { * @see java.util.Collections.rotate * @see floatArrayOf */ +@JvmOverloads fun FloatArray.rotateLeft(n: Int = 1): FloatArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() @@ -1989,6 +2084,7 @@ fun FloatArray.rotateLeft(n: Int = 1): FloatArray { * @see java.util.Collections.rotate * @see doubleArrayOf */ +@JvmOverloads fun DoubleArray.rotateLeft(n: Int = 1): DoubleArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() @@ -2009,6 +2105,7 @@ fun DoubleArray.rotateLeft(n: Int = 1): DoubleArray { * @see java.util.Collections.rotate * @see booleanArrayOf */ +@JvmOverloads fun BooleanArray.rotateLeft(n: Int = 1): BooleanArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() @@ -2049,6 +2146,7 @@ inline fun Array.rotateRight(n: Int = 1): Array { * @see java.util.Collections.rotate * @see byteArrayOf */ +@JvmOverloads fun ByteArray.rotateRight(n: Int = 1): ByteArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() @@ -2069,6 +2167,7 @@ fun ByteArray.rotateRight(n: Int = 1): ByteArray { * @see java.util.Collections.rotate * @see shortArrayOf */ +@JvmOverloads fun ShortArray.rotateRight(n: Int = 1): ShortArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() @@ -2089,6 +2188,7 @@ fun ShortArray.rotateRight(n: Int = 1): ShortArray { * @see java.util.Collections.rotate * @see charArrayOf */ +@JvmOverloads fun CharArray.rotateRight(n: Int = 1): CharArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() @@ -2109,6 +2209,7 @@ fun CharArray.rotateRight(n: Int = 1): CharArray { * @see java.util.Collections.rotate * @see intArrayOf */ +@JvmOverloads fun IntArray.rotateRight(n: Int = 1): IntArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() @@ -2129,6 +2230,7 @@ fun IntArray.rotateRight(n: Int = 1): IntArray { * @see java.util.Collections.rotate * @see longArrayOf */ +@JvmOverloads fun LongArray.rotateRight(n: Int = 1): LongArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() @@ -2149,6 +2251,7 @@ fun LongArray.rotateRight(n: Int = 1): LongArray { * @see java.util.Collections.rotate * @see floatArrayOf */ +@JvmOverloads fun FloatArray.rotateRight(n: Int = 1): FloatArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() @@ -2169,6 +2272,7 @@ fun FloatArray.rotateRight(n: Int = 1): FloatArray { * @see java.util.Collections.rotate * @see doubleArrayOf */ +@JvmOverloads fun DoubleArray.rotateRight(n: Int = 1): DoubleArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() @@ -2189,6 +2293,7 @@ fun DoubleArray.rotateRight(n: Int = 1): DoubleArray { * @see java.util.Collections.rotate * @see booleanArrayOf */ +@JvmOverloads fun BooleanArray.rotateRight(n: Int = 1): BooleanArray { require(n >= 1) { ROTATE_N_SIZE } val list = this.toMutableList() diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Collections.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Collections.kt index 7688b0a6..895bd41e 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Collections.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Collections.kt @@ -12,7 +12,9 @@ import com.parsuomash.affogato.core.ktx.tryCatchNull * ``` * @since 1.1.0 */ -inline val Collection.lastIndex: Int get() = size - 1 +@get:JvmSynthetic +inline val Collection.lastIndex: Int + get() = size - 1 /** * Returns an element at the given index or empty @@ -27,6 +29,7 @@ inline val Collection.lastIndex: Int get() = size - 1 * @since 1.1.0 * @see listOf */ +@JvmSynthetic fun Collection.getOrEmpty(index: Int): String = if (index in 0..lastIndex) toList()[index] else "" diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/List.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/List.kt index 459b0b6d..b6e302f7 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/List.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/List.kt @@ -12,6 +12,7 @@ package com.parsuomash.affogato.core.ktx.collections * @since 1.1.0 * @see listOf */ +@JvmSynthetic fun listOf(range: IntRange): List = range.toList() /** @@ -24,6 +25,7 @@ fun listOf(range: IntRange): List = range.toList() * @since 1.1.0 * @see listOf */ +@JvmSynthetic fun listOf(range: UIntRange): List = range.toList() /** @@ -36,6 +38,7 @@ fun listOf(range: UIntRange): List = range.toList() * @since 1.1.0 * @see listOf */ +@JvmSynthetic fun listOf(range: LongRange): List = range.toList() /** @@ -48,6 +51,7 @@ fun listOf(range: LongRange): List = range.toList() * @since 1.1.0 * @see listOf */ +@JvmSynthetic fun listOf(range: ULongRange): List = range.toList() /** @@ -60,6 +64,7 @@ fun listOf(range: ULongRange): List = range.toList() * @since 1.1.0 * @see listOf */ +@JvmSynthetic fun listOf(progression: IntProgression): List = progression.toList() /** @@ -72,6 +77,7 @@ fun listOf(progression: IntProgression): List = progression.toList() * @since 1.1.0 * @see listOf */ +@JvmSynthetic fun listOf(progression: UIntProgression): List = progression.toList() /** @@ -84,6 +90,7 @@ fun listOf(progression: UIntProgression): List = progression.toList() * @since 1.1.0 * @see listOf */ +@JvmSynthetic fun listOf(progression: LongProgression): List = progression.toList() /** @@ -96,6 +103,7 @@ fun listOf(progression: LongProgression): List = progression.toList() * @since 1.1.0 * @see listOf */ +@JvmSynthetic fun listOf(progression: ULongProgression): List = progression.toList() /** @@ -108,6 +116,7 @@ fun listOf(progression: ULongProgression): List = progression.toList() * @since 1.1.0 * @see listOf */ +@JvmSynthetic fun listOf(range: CharRange): List = range.toList() /** @@ -120,6 +129,7 @@ fun listOf(range: CharRange): List = range.toList() * @since 1.1.0 * @see listOf */ +@JvmSynthetic fun listOf(progression: CharProgression): List = progression.toList() /** @@ -132,6 +142,7 @@ fun listOf(progression: CharProgression): List = progression.toList() * @since 1.1.0 * @see mutableListOf */ +@JvmSynthetic fun mutableListOf(range: IntRange): MutableList = range.toMutableList() /** @@ -144,6 +155,7 @@ fun mutableListOf(range: IntRange): MutableList = range.toMutableList() * @since 1.1.0 * @see mutableListOf */ +@JvmSynthetic fun mutableListOf(range: UIntRange): MutableList = range.toMutableList() /** @@ -156,6 +168,7 @@ fun mutableListOf(range: UIntRange): MutableList = range.toMutableList() * @since 1.1.0 * @see mutableListOf */ +@JvmSynthetic fun mutableListOf(range: LongRange): MutableList = range.toMutableList() /** @@ -168,6 +181,7 @@ fun mutableListOf(range: LongRange): MutableList = range.toMutableList() * @since 1.1.0 * @see mutableListOf */ +@JvmSynthetic fun mutableListOf(range: ULongRange): MutableList = range.toMutableList() /** @@ -180,6 +194,7 @@ fun mutableListOf(range: ULongRange): MutableList = range.toMutableList() * @since 1.1.0 * @see mutableListOf */ +@JvmSynthetic fun mutableListOf(progression: IntProgression): MutableList = progression.toMutableList() /** @@ -192,6 +207,7 @@ fun mutableListOf(progression: IntProgression): MutableList = progression.t * @since 1.1.0 * @see mutableListOf */ +@JvmSynthetic fun mutableListOf(progression: UIntProgression): MutableList = progression.toMutableList() /** @@ -204,6 +220,7 @@ fun mutableListOf(progression: UIntProgression): MutableList = progression * @since 1.1.0 * @see mutableListOf */ +@JvmSynthetic fun mutableListOf(progression: LongProgression): MutableList = progression.toMutableList() /** @@ -216,6 +233,7 @@ fun mutableListOf(progression: LongProgression): MutableList = progression * @since 1.1.0 * @see mutableListOf */ +@JvmSynthetic fun mutableListOf(progression: ULongProgression): MutableList = progression.toMutableList() /** @@ -228,6 +246,7 @@ fun mutableListOf(progression: ULongProgression): MutableList = progressi * @since 1.1.0 * @see mutableListOf */ +@JvmSynthetic fun mutableListOf(range: CharRange): MutableList = range.toMutableList() /** @@ -240,6 +259,7 @@ fun mutableListOf(range: CharRange): MutableList = range.toMutableList() * @since 1.1.0 * @see mutableListOf */ +@JvmSynthetic fun mutableListOf(progression: CharProgression): MutableList = progression.toMutableList() /** @@ -252,6 +272,7 @@ fun mutableListOf(progression: CharProgression): MutableList = progression * @since 1.1.0 * @see arrayListOf */ +@JvmSynthetic fun arrayListOf(range: IntRange): ArrayList = ArrayList(range.toList()) /** @@ -264,6 +285,7 @@ fun arrayListOf(range: IntRange): ArrayList = ArrayList(range.toList()) * @since 1.1.0 * @see arrayListOf */ +@JvmSynthetic fun arrayListOf(range: UIntRange): ArrayList = ArrayList(range.toList()) /** @@ -276,6 +298,7 @@ fun arrayListOf(range: UIntRange): ArrayList = ArrayList(range.toList()) * @since 1.1.0 * @see arrayListOf */ +@JvmSynthetic fun arrayListOf(range: LongRange): ArrayList = ArrayList(range.toList()) /** @@ -288,6 +311,7 @@ fun arrayListOf(range: LongRange): ArrayList = ArrayList(range.toList()) * @since 1.1.0 * @see arrayListOf */ +@JvmSynthetic fun arrayListOf(range: ULongRange): ArrayList = ArrayList(range.toList()) /** @@ -300,6 +324,7 @@ fun arrayListOf(range: ULongRange): ArrayList = ArrayList(range.toList()) * @since 1.1.0 * @see arrayListOf */ +@JvmSynthetic fun arrayListOf(progression: IntProgression): ArrayList = ArrayList(progression.toList()) /** @@ -312,6 +337,7 @@ fun arrayListOf(progression: IntProgression): ArrayList = ArrayList(progres * @since 1.1.0 * @see arrayListOf */ +@JvmSynthetic fun arrayListOf(progression: UIntProgression): ArrayList = ArrayList(progression.toList()) /** @@ -324,6 +350,7 @@ fun arrayListOf(progression: UIntProgression): ArrayList = ArrayList(progr * @since 1.1.0 * @see arrayListOf */ +@JvmSynthetic fun arrayListOf(progression: LongProgression): ArrayList = ArrayList(progression.toList()) /** @@ -336,6 +363,7 @@ fun arrayListOf(progression: LongProgression): ArrayList = ArrayList(progr * @since 1.1.0 * @see arrayListOf */ +@JvmSynthetic fun arrayListOf(progression: ULongProgression): ArrayList = ArrayList(progression.toList()) /** @@ -348,6 +376,7 @@ fun arrayListOf(progression: ULongProgression): ArrayList = ArrayList(pro * @since 1.1.0 * @see arrayListOf */ +@JvmSynthetic fun arrayListOf(range: CharRange): ArrayList = ArrayList(range.toList()) /** @@ -360,6 +389,7 @@ fun arrayListOf(range: CharRange): ArrayList = ArrayList(range.toList()) * @since 1.1.0 * @see arrayListOf */ +@JvmSynthetic fun arrayListOf(progression: CharProgression): ArrayList = ArrayList(progression.toList()) /** @@ -385,6 +415,7 @@ inline fun linkedListOf(vararg elements: T): LinkedList = * @since 1.1.0 * @see linkedListOf */ +@JvmSynthetic fun linkedListOf(range: IntRange): LinkedList = LinkedList(range.toList()) /** @@ -397,6 +428,7 @@ fun linkedListOf(range: IntRange): LinkedList = LinkedList(range.toList()) * @since 1.1.0 * @see linkedListOf */ +@JvmSynthetic fun linkedListOf(range: UIntRange): LinkedList = LinkedList(range.toList()) /** @@ -409,6 +441,7 @@ fun linkedListOf(range: UIntRange): LinkedList = LinkedList(range.toList() * @since 1.1.0 * @see linkedListOf */ +@JvmSynthetic fun linkedListOf(range: LongRange): LinkedList = LinkedList(range.toList()) /** @@ -421,6 +454,7 @@ fun linkedListOf(range: LongRange): LinkedList = LinkedList(range.toList() * @since 1.1.0 * @see linkedListOf */ +@JvmSynthetic fun linkedListOf(range: ULongRange): LinkedList = LinkedList(range.toList()) /** @@ -433,6 +467,7 @@ fun linkedListOf(range: ULongRange): LinkedList = LinkedList(range.toList * @since 1.1.0 * @see linkedListOf */ +@JvmSynthetic fun linkedListOf(progression: IntProgression): LinkedList = LinkedList(progression.toList()) /** @@ -445,6 +480,7 @@ fun linkedListOf(progression: IntProgression): LinkedList = LinkedList(prog * @since 1.1.0 * @see linkedListOf */ +@JvmSynthetic fun linkedListOf(progression: UIntProgression): LinkedList = LinkedList(progression.toList()) /** @@ -457,6 +493,7 @@ fun linkedListOf(progression: UIntProgression): LinkedList = LinkedList(pr * @since 1.1.0 * @see linkedListOf */ +@JvmSynthetic fun linkedListOf(progression: LongProgression): LinkedList = LinkedList(progression.toList()) /** @@ -469,6 +506,7 @@ fun linkedListOf(progression: LongProgression): LinkedList = LinkedList(pr * @since 1.1.0 * @see linkedListOf */ +@JvmSynthetic fun linkedListOf(progression: ULongProgression): LinkedList = LinkedList(progression.toList()) @@ -482,6 +520,7 @@ fun linkedListOf(progression: ULongProgression): LinkedList = * @since 1.1.0 * @see linkedListOf */ +@JvmSynthetic fun linkedListOf(range: CharRange): LinkedList = LinkedList(range.toList()) /** @@ -494,6 +533,7 @@ fun linkedListOf(range: CharRange): LinkedList = LinkedList(range.toList() * @since 1.1.0 * @see linkedListOf */ +@JvmSynthetic fun linkedListOf(progression: CharProgression): LinkedList = LinkedList(progression.toList()) /** diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Queue.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Queue.kt index c85d4072..4d76a718 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Queue.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Queue.kt @@ -70,6 +70,7 @@ inline fun queueOf(vararg elements: T): Queue = LinkedList(elemen * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun queueOf(range: IntRange): Queue = LinkedList(range.toList()) /** @@ -82,6 +83,7 @@ fun queueOf(range: IntRange): Queue = LinkedList(range.toList()) * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun queueOf(range: UIntRange): Queue = LinkedList(range.toList()) /** @@ -94,6 +96,7 @@ fun queueOf(range: UIntRange): Queue = LinkedList(range.toList()) * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun queueOf(range: LongRange): Queue = LinkedList(range.toList()) /** @@ -106,6 +109,7 @@ fun queueOf(range: LongRange): Queue = LinkedList(range.toList()) * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun queueOf(range: ULongRange): Queue = LinkedList(range.toList()) /** @@ -118,6 +122,7 @@ fun queueOf(range: ULongRange): Queue = LinkedList(range.toList()) * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun queueOf(progression: IntProgression): Queue = LinkedList(progression.toList()) /** @@ -130,6 +135,7 @@ fun queueOf(progression: IntProgression): Queue = LinkedList(progression.to * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun queueOf(progression: UIntProgression): Queue = LinkedList(progression.toList()) /** @@ -142,6 +148,7 @@ fun queueOf(progression: UIntProgression): Queue = LinkedList(progression. * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun queueOf(progression: LongProgression): Queue = LinkedList(progression.toList()) /** @@ -154,6 +161,7 @@ fun queueOf(progression: LongProgression): Queue = LinkedList(progression. * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun queueOf(progression: ULongProgression): Queue = LinkedList(progression.toList()) @@ -167,6 +175,7 @@ fun queueOf(progression: ULongProgression): Queue = * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun queueOf(range: CharRange): Queue = LinkedList(range.toList()) /** @@ -179,6 +188,7 @@ fun queueOf(range: CharRange): Queue = LinkedList(range.toList()) * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun queueOf(progression: CharProgression): Queue = LinkedList(progression.toList()) /** @@ -203,6 +213,7 @@ inline fun priorityQueueOf(vararg elements: T): PriorityQueue = * ``` * @since 1.1.0 */ +@JvmSynthetic fun priorityQueueOf(range: IntRange): PriorityQueue = PriorityQueue(range.toList()) /** @@ -214,6 +225,7 @@ fun priorityQueueOf(range: IntRange): PriorityQueue = PriorityQueue(range.t * ``` * @since 1.1.0 */ +@JvmSynthetic fun priorityQueueOf(range: UIntRange): PriorityQueue = PriorityQueue(range.toList()) /** @@ -225,6 +237,7 @@ fun priorityQueueOf(range: UIntRange): PriorityQueue = PriorityQueue(range * ``` * @since 1.1.0 */ +@JvmSynthetic fun priorityQueueOf(range: LongRange): PriorityQueue = PriorityQueue(range.toList()) /** @@ -236,6 +249,7 @@ fun priorityQueueOf(range: LongRange): PriorityQueue = PriorityQueue(range * ``` * @since 1.1.0 */ +@JvmSynthetic fun priorityQueueOf(range: ULongRange): PriorityQueue = PriorityQueue(range.toList()) /** @@ -247,6 +261,7 @@ fun priorityQueueOf(range: ULongRange): PriorityQueue = PriorityQueue(ran * ``` * @since 1.1.0 */ +@JvmSynthetic fun priorityQueueOf(progression: IntProgression): PriorityQueue = PriorityQueue(progression.toList()) @@ -259,6 +274,7 @@ fun priorityQueueOf(progression: IntProgression): PriorityQueue = * ``` * @since 1.1.0 */ +@JvmSynthetic fun priorityQueueOf(progression: UIntProgression): PriorityQueue = PriorityQueue(progression.toList()) @@ -271,6 +287,7 @@ fun priorityQueueOf(progression: UIntProgression): PriorityQueue = * ``` * @since 1.1.0 */ +@JvmSynthetic fun priorityQueueOf(progression: LongProgression): PriorityQueue = PriorityQueue(progression.toList()) @@ -283,6 +300,7 @@ fun priorityQueueOf(progression: LongProgression): PriorityQueue = * ``` * @since 1.1.0 */ +@JvmSynthetic fun priorityQueueOf(progression: ULongProgression): PriorityQueue = PriorityQueue(progression.toList()) @@ -295,6 +313,7 @@ fun priorityQueueOf(progression: ULongProgression): PriorityQueue = * ``` * @since 1.1.0 */ +@JvmSynthetic fun priorityQueueOf(range: CharRange): PriorityQueue = PriorityQueue(range.toList()) /** @@ -306,6 +325,7 @@ fun priorityQueueOf(range: CharRange): PriorityQueue = PriorityQueue(range * ``` * @since 1.1.0 */ +@JvmSynthetic fun priorityQueueOf(progression: CharProgression): PriorityQueue = PriorityQueue(progression.toList()) @@ -331,6 +351,7 @@ inline fun dequeOf(vararg elements: T): Deque = LinkedList(elemen * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun dequeOf(range: IntRange): Deque = LinkedList(range.toList()) /** @@ -343,6 +364,7 @@ fun dequeOf(range: IntRange): Deque = LinkedList(range.toList()) * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun dequeOf(range: UIntRange): Deque = LinkedList(range.toList()) /** @@ -355,6 +377,7 @@ fun dequeOf(range: UIntRange): Deque = LinkedList(range.toList()) * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun dequeOf(range: LongRange): Deque = LinkedList(range.toList()) /** @@ -367,6 +390,7 @@ fun dequeOf(range: LongRange): Deque = LinkedList(range.toList()) * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun dequeOf(range: ULongRange): Deque = LinkedList(range.toList()) /** @@ -379,6 +403,7 @@ fun dequeOf(range: ULongRange): Deque = LinkedList(range.toList()) * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun dequeOf(progression: IntProgression): Deque = LinkedList(progression.toList()) /** @@ -391,6 +416,7 @@ fun dequeOf(progression: IntProgression): Deque = LinkedList(progression.to * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun dequeOf(progression: UIntProgression): Deque = LinkedList(progression.toList()) /** @@ -403,6 +429,7 @@ fun dequeOf(progression: UIntProgression): Deque = LinkedList(progression. * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun dequeOf(progression: LongProgression): Deque = LinkedList(progression.toList()) /** @@ -415,6 +442,7 @@ fun dequeOf(progression: LongProgression): Deque = LinkedList(progression. * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun dequeOf(progression: ULongProgression): Deque = LinkedList(progression.toList()) /** @@ -427,6 +455,7 @@ fun dequeOf(progression: ULongProgression): Deque = LinkedList(progressio * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun dequeOf(range: CharRange): Deque = LinkedList(range.toList()) /** @@ -439,6 +468,7 @@ fun dequeOf(range: CharRange): Deque = LinkedList(range.toList()) * @since 1.1.0 * @see LinkedList */ +@JvmSynthetic fun dequeOf(progression: CharProgression): Deque = LinkedList(progression.toList()) /** @@ -463,6 +493,7 @@ inline fun arrayDequeOf(vararg elements: T): ArrayDeque = * ``` * @since 1.1.0 */ +@JvmSynthetic fun arrayDequeOf(range: IntRange): ArrayDeque = ArrayDeque(range.toList()) /** @@ -474,6 +505,7 @@ fun arrayDequeOf(range: IntRange): ArrayDeque = ArrayDeque(range.toList()) * ``` * @since 1.1.0 */ +@JvmSynthetic fun arrayDequeOf(range: UIntRange): ArrayDeque = ArrayDeque(range.toList()) /** @@ -485,6 +517,7 @@ fun arrayDequeOf(range: UIntRange): ArrayDeque = ArrayDeque(range.toList() * ``` * @since 1.1.0 */ +@JvmSynthetic fun arrayDequeOf(range: LongRange): ArrayDeque = ArrayDeque(range.toList()) /** @@ -496,6 +529,7 @@ fun arrayDequeOf(range: LongRange): ArrayDeque = ArrayDeque(range.toList() * ``` * @since 1.1.0 */ +@JvmSynthetic fun arrayDequeOf(range: ULongRange): ArrayDeque = ArrayDeque(range.toList()) /** @@ -507,6 +541,7 @@ fun arrayDequeOf(range: ULongRange): ArrayDeque = ArrayDeque(range.toList * ``` * @since 1.1.0 */ +@JvmSynthetic fun arrayDequeOf(progression: IntProgression): ArrayDeque = ArrayDeque(progression.toList()) /** @@ -518,6 +553,7 @@ fun arrayDequeOf(progression: IntProgression): ArrayDeque = ArrayDeque(prog * ``` * @since 1.1.0 */ +@JvmSynthetic fun arrayDequeOf(progression: UIntProgression): ArrayDeque = ArrayDeque(progression.toList()) /** @@ -529,6 +565,7 @@ fun arrayDequeOf(progression: UIntProgression): ArrayDeque = ArrayDeque(pr * ``` * @since 1.1.0 */ +@JvmSynthetic fun arrayDequeOf(progression: LongProgression): ArrayDeque = ArrayDeque(progression.toList()) /** @@ -540,6 +577,7 @@ fun arrayDequeOf(progression: LongProgression): ArrayDeque = ArrayDeque(pr * ``` * @since 1.1.0 */ +@JvmSynthetic fun arrayDequeOf(progression: ULongProgression): ArrayDeque = ArrayDeque(progression.toList()) @@ -552,6 +590,7 @@ fun arrayDequeOf(progression: ULongProgression): ArrayDeque = * ``` * @since 1.1.0 */ +@JvmSynthetic fun arrayDequeOf(range: CharRange): ArrayDeque = ArrayDeque(range.toList()) /** @@ -563,6 +602,7 @@ fun arrayDequeOf(range: CharRange): ArrayDeque = ArrayDeque(range.toList() * ``` * @since 1.1.0 */ +@JvmSynthetic fun arrayDequeOf(progression: CharProgression): ArrayDeque = ArrayDeque(progression.toList()) /** diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Set.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Set.kt index f60fab86..2b1bf0f1 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Set.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Set.kt @@ -44,6 +44,7 @@ inline fun Pair.toHashTable(): Hashtable = Hashtable( * ``` * @since 1.1.0 */ +@JvmSynthetic fun setOf(range: IntRange): Set = range.toSet() /** @@ -55,6 +56,7 @@ fun setOf(range: IntRange): Set = range.toSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun setOf(range: UIntRange): Set = range.toSet() /** @@ -66,6 +68,7 @@ fun setOf(range: UIntRange): Set = range.toSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun setOf(range: LongRange): Set = range.toSet() /** @@ -77,6 +80,7 @@ fun setOf(range: LongRange): Set = range.toSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun setOf(range: ULongRange): Set = range.toSet() /** @@ -88,6 +92,7 @@ fun setOf(range: ULongRange): Set = range.toSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun setOf(progression: IntProgression): Set = progression.toSet() /** @@ -99,6 +104,7 @@ fun setOf(progression: IntProgression): Set = progression.toSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun setOf(progression: UIntProgression): Set = progression.toSet() /** @@ -110,6 +116,7 @@ fun setOf(progression: UIntProgression): Set = progression.toSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun setOf(progression: LongProgression): Set = progression.toSet() /** @@ -121,6 +128,7 @@ fun setOf(progression: LongProgression): Set = progression.toSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun setOf(progression: ULongProgression): Set = progression.toSet() @@ -133,6 +141,7 @@ fun setOf(progression: ULongProgression): Set = * ``` * @since 1.1.0 */ +@JvmSynthetic fun setOf(range: CharRange): Set = range.toSet() /** @@ -144,6 +153,7 @@ fun setOf(range: CharRange): Set = range.toSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun setOf(progression: CharProgression): Set = progression.toSet() /** @@ -155,6 +165,7 @@ fun setOf(progression: CharProgression): Set = progression.toSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun mutableSetOf(range: IntRange): MutableSet = range.toMutableSet() /** @@ -166,6 +177,7 @@ fun mutableSetOf(range: IntRange): MutableSet = range.toMutableSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun mutableSetOf(range: UIntRange): MutableSet = range.toMutableSet() /** @@ -177,6 +189,7 @@ fun mutableSetOf(range: UIntRange): MutableSet = range.toMutableSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun mutableSetOf(range: LongRange): MutableSet = range.toMutableSet() /** @@ -188,6 +201,7 @@ fun mutableSetOf(range: LongRange): MutableSet = range.toMutableSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun mutableSetOf(range: ULongRange): MutableSet = range.toMutableSet() /** @@ -199,6 +213,7 @@ fun mutableSetOf(range: ULongRange): MutableSet = range.toMutableSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun mutableSetOf(progression: IntProgression): MutableSet = progression.toMutableSet() /** @@ -210,6 +225,7 @@ fun mutableSetOf(progression: IntProgression): MutableSet = progression.toM * ``` * @since 1.1.0 */ +@JvmSynthetic fun mutableSetOf(progression: UIntProgression): MutableSet = progression.toMutableSet() /** @@ -221,6 +237,7 @@ fun mutableSetOf(progression: UIntProgression): MutableSet = progression.t * ``` * @since 1.1.0 */ +@JvmSynthetic fun mutableSetOf(progression: LongProgression): MutableSet = progression.toMutableSet() /** @@ -232,6 +249,7 @@ fun mutableSetOf(progression: LongProgression): MutableSet = progression.t * ``` * @since 1.1.0 */ +@JvmSynthetic fun mutableSetOf(progression: ULongProgression): MutableSet = progression.toMutableSet() @@ -244,6 +262,7 @@ fun mutableSetOf(progression: ULongProgression): MutableSet = * ``` * @since 1.1.0 */ +@JvmSynthetic fun mutableSetOf(range: CharRange): MutableSet = range.toMutableSet() /** @@ -255,6 +274,7 @@ fun mutableSetOf(range: CharRange): MutableSet = range.toMutableSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun mutableSetOf(progression: CharProgression): MutableSet = progression.toMutableSet() /** @@ -266,6 +286,7 @@ fun mutableSetOf(progression: CharProgression): MutableSet = progression.t * ``` * @since 1.1.0 */ +@JvmSynthetic fun hashSetOf(range: IntRange): HashSet = range.toHashSet() /** @@ -277,6 +298,7 @@ fun hashSetOf(range: IntRange): HashSet = range.toHashSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun hashSetOf(range: UIntRange): HashSet = range.toHashSet() /** @@ -288,6 +310,7 @@ fun hashSetOf(range: UIntRange): HashSet = range.toHashSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun hashSetOf(range: LongRange): HashSet = range.toHashSet() /** @@ -299,6 +322,7 @@ fun hashSetOf(range: LongRange): HashSet = range.toHashSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun hashSetOf(range: ULongRange): HashSet = range.toHashSet() /** @@ -310,6 +334,7 @@ fun hashSetOf(range: ULongRange): HashSet = range.toHashSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun hashSetOf(progression: IntProgression): HashSet = progression.toHashSet() /** @@ -321,6 +346,7 @@ fun hashSetOf(progression: IntProgression): HashSet = progression.toHashSet * ``` * @since 1.1.0 */ +@JvmSynthetic fun hashSetOf(progression: UIntProgression): HashSet = progression.toHashSet() /** @@ -332,6 +358,7 @@ fun hashSetOf(progression: UIntProgression): HashSet = progression.toHashS * ``` * @since 1.1.0 */ +@JvmSynthetic fun hashSetOf(progression: LongProgression): HashSet = progression.toHashSet() /** @@ -343,6 +370,7 @@ fun hashSetOf(progression: LongProgression): HashSet = progression.toHashS * ``` * @since 1.1.0 */ +@JvmSynthetic fun hashSetOf(progression: ULongProgression): HashSet = progression.toHashSet() @@ -355,6 +383,7 @@ fun hashSetOf(progression: ULongProgression): HashSet = * ``` * @since 1.1.0 */ +@JvmSynthetic fun hashSetOf(range: CharRange): HashSet = range.toHashSet() /** @@ -366,6 +395,7 @@ fun hashSetOf(range: CharRange): HashSet = range.toHashSet() * ``` * @since 1.1.0 */ +@JvmSynthetic fun hashSetOf(progression: CharProgression): HashSet = progression.toHashSet() /** @@ -377,6 +407,7 @@ fun hashSetOf(progression: CharProgression): HashSet = progression.toHashS * ``` * @since 1.1.0 */ +@JvmSynthetic fun linkedSetOf(range: IntRange): LinkedHashSet = LinkedHashSet(range.toList()) /** @@ -388,6 +419,7 @@ fun linkedSetOf(range: IntRange): LinkedHashSet = LinkedHashSet(range.toLis * ``` * @since 1.1.0 */ +@JvmSynthetic fun linkedSetOf(range: UIntRange): LinkedHashSet = LinkedHashSet(range.toList()) /** @@ -399,6 +431,7 @@ fun linkedSetOf(range: UIntRange): LinkedHashSet = LinkedHashSet(range.toL * ``` * @since 1.1.0 */ +@JvmSynthetic fun linkedSetOf(range: LongRange): LinkedHashSet = LinkedHashSet(range.toList()) /** @@ -410,6 +443,7 @@ fun linkedSetOf(range: LongRange): LinkedHashSet = LinkedHashSet(range.toL * ``` * @since 1.1.0 */ +@JvmSynthetic fun linkedSetOf(range: ULongRange): LinkedHashSet = LinkedHashSet(range.toList()) /** @@ -421,6 +455,7 @@ fun linkedSetOf(range: ULongRange): LinkedHashSet = LinkedHashSet(range.t * ``` * @since 1.1.0 */ +@JvmSynthetic fun linkedSetOf(progression: IntProgression): LinkedHashSet = LinkedHashSet(progression.toList()) @@ -433,6 +468,7 @@ fun linkedSetOf(progression: IntProgression): LinkedHashSet = * ``` * @since 1.1.0 */ +@JvmSynthetic fun linkedSetOf(progression: UIntProgression): LinkedHashSet = LinkedHashSet(progression.toList()) @@ -445,6 +481,7 @@ fun linkedSetOf(progression: UIntProgression): LinkedHashSet = * ``` * @since 1.1.0 */ +@JvmSynthetic fun linkedSetOf(progression: LongProgression): LinkedHashSet = LinkedHashSet(progression.toList()) @@ -457,6 +494,7 @@ fun linkedSetOf(progression: LongProgression): LinkedHashSet = * ``` * @since 1.1.0 */ +@JvmSynthetic fun linkedSetOf(progression: ULongProgression): LinkedHashSet = LinkedHashSet(progression.toList()) @@ -469,6 +507,7 @@ fun linkedSetOf(progression: ULongProgression): LinkedHashSet = * ``` * @since 1.1.0 */ +@JvmSynthetic fun linkedSetOf(range: CharRange): LinkedHashSet = LinkedHashSet(range.toList()) /** @@ -480,6 +519,7 @@ fun linkedSetOf(range: CharRange): LinkedHashSet = LinkedHashSet(range.toL * ``` * @since 1.1.0 */ +@JvmSynthetic fun linkedSetOf(progression: CharProgression): LinkedHashSet = LinkedHashSet(progression.toList()) @@ -493,6 +533,7 @@ fun linkedSetOf(progression: CharProgression): LinkedHashSet = * @since 1.1.0 * @see SortedSet */ +@JvmSynthetic fun sortedSetOf(range: IntRange): TreeSet = TreeSet(range.toList()) /** @@ -505,6 +546,7 @@ fun sortedSetOf(range: IntRange): TreeSet = TreeSet(range.toList()) * @since 1.1.0 * @see SortedSet */ +@JvmSynthetic fun sortedSetOf(range: UIntRange): TreeSet = TreeSet(range.toList()) /** @@ -517,6 +559,7 @@ fun sortedSetOf(range: UIntRange): TreeSet = TreeSet(range.toList()) * @since 1.1.0 * @see SortedSet */ +@JvmSynthetic fun sortedSetOf(range: LongRange): TreeSet = TreeSet(range.toList()) /** @@ -529,6 +572,7 @@ fun sortedSetOf(range: LongRange): TreeSet = TreeSet(range.toList()) * @since 1.1.0 * @see SortedSet */ +@JvmSynthetic fun sortedSetOf(range: ULongRange): TreeSet = TreeSet(range.toList()) /** @@ -541,6 +585,7 @@ fun sortedSetOf(range: ULongRange): TreeSet = TreeSet(range.toList()) * @since 1.1.0 * @see SortedSet */ +@JvmSynthetic fun sortedSetOf(progression: IntProgression): TreeSet = TreeSet(progression.toList()) /** @@ -553,6 +598,7 @@ fun sortedSetOf(progression: IntProgression): TreeSet = TreeSet(progression * @since 1.1.0 * @see SortedSet */ +@JvmSynthetic fun sortedSetOf(progression: UIntProgression): TreeSet = TreeSet(progression.toList()) /** @@ -565,6 +611,7 @@ fun sortedSetOf(progression: UIntProgression): TreeSet = TreeSet(progressi * @since 1.1.0 * @see SortedSet */ +@JvmSynthetic fun sortedSetOf(progression: LongProgression): TreeSet = TreeSet(progression.toList()) /** @@ -577,6 +624,7 @@ fun sortedSetOf(progression: LongProgression): TreeSet = TreeSet(progressi * @since 1.1.0 * @see SortedSet */ +@JvmSynthetic fun sortedSetOf(progression: ULongProgression): TreeSet = TreeSet(progression.toList()) /** @@ -589,6 +637,7 @@ fun sortedSetOf(progression: ULongProgression): TreeSet = TreeSet(progres * @since 1.1.0 * @see SortedSet */ +@JvmSynthetic fun sortedSetOf(range: CharRange): TreeSet = TreeSet(range.toList()) /** @@ -601,6 +650,7 @@ fun sortedSetOf(range: CharRange): TreeSet = TreeSet(range.toList()) * @since 1.1.0 * @see SortedSet */ +@JvmSynthetic fun sortedSetOf(progression: CharProgression): TreeSet = TreeSet(progression.toList()) /** diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Stack.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Stack.kt index 03c601a4..5911972e 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Stack.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Stack.kt @@ -34,6 +34,7 @@ inline fun stackOf(vararg elements: T): Stack = Stack().apply * ``` * @since 1.1.0 */ +@JvmSynthetic fun stackOf(range: IntRange): Stack = Stack().apply { addAll(range) } /** @@ -45,6 +46,7 @@ fun stackOf(range: IntRange): Stack = Stack().apply { addAll(range) } * ``` * @since 1.1.0 */ +@JvmSynthetic fun stackOf(range: UIntRange): Stack = Stack().apply { addAll(range) } /** @@ -56,6 +58,7 @@ fun stackOf(range: UIntRange): Stack = Stack().apply { addAll(range) * ``` * @since 1.1.0 */ +@JvmSynthetic fun stackOf(range: LongRange): Stack = Stack().apply { addAll(range) } /** @@ -67,6 +70,7 @@ fun stackOf(range: LongRange): Stack = Stack().apply { addAll(range) * ``` * @since 1.1.0 */ +@JvmSynthetic fun stackOf(range: ULongRange): Stack = Stack().apply { addAll(range) } /** @@ -78,6 +82,7 @@ fun stackOf(range: ULongRange): Stack = Stack().apply { addAll(ran * ``` * @since 1.1.0 */ +@JvmSynthetic fun stackOf(progression: IntProgression): Stack = Stack().apply { addAll(progression) } /** @@ -89,6 +94,7 @@ fun stackOf(progression: IntProgression): Stack = Stack().apply { addA * ``` * @since 1.1.0 */ +@JvmSynthetic fun stackOf(progression: UIntProgression): Stack = Stack().apply { addAll(progression) } /** @@ -100,6 +106,7 @@ fun stackOf(progression: UIntProgression): Stack = Stack().apply { a * ``` * @since 1.1.0 */ +@JvmSynthetic fun stackOf(progression: LongProgression): Stack = Stack().apply { addAll(progression) } /** @@ -111,6 +118,7 @@ fun stackOf(progression: LongProgression): Stack = Stack().apply { a * ``` * @since 1.1.0 */ +@JvmSynthetic fun stackOf(progression: ULongProgression): Stack = Stack().apply { addAll(progression) } @@ -123,6 +131,7 @@ fun stackOf(progression: ULongProgression): Stack = * ``` * @since 1.1.0 */ +@JvmSynthetic fun stackOf(range: CharRange): Stack = Stack().apply { addAll(range) } /** @@ -134,6 +143,7 @@ fun stackOf(range: CharRange): Stack = Stack().apply { addAll(range) * ``` * @since 1.1.0 */ +@JvmSynthetic fun stackOf(progression: CharProgression): Stack = Stack().apply { addAll(progression) } /** diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Vector.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Vector.kt index 4d260d41..f21bdc53 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Vector.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/collections/Vector.kt @@ -37,6 +37,7 @@ inline fun vectorOf(vararg elements: T): Vector = Vector(elements * ``` * @since 1.1.0 */ +@JvmSynthetic fun vectorOf(range: IntRange): Vector = Vector(range.toList()) /** @@ -48,6 +49,7 @@ fun vectorOf(range: IntRange): Vector = Vector(range.toList()) * ``` * @since 1.1.0 */ +@JvmSynthetic fun vectorOf(range: UIntRange): Vector = Vector(range.toList()) /** @@ -59,6 +61,7 @@ fun vectorOf(range: UIntRange): Vector = Vector(range.toList()) * ``` * @since 1.1.0 */ +@JvmSynthetic fun vectorOf(range: LongRange): Vector = Vector(range.toList()) /** @@ -70,6 +73,7 @@ fun vectorOf(range: LongRange): Vector = Vector(range.toList()) * ``` * @since 1.1.0 */ +@JvmSynthetic fun vectorOf(range: ULongRange): Vector = Vector(range.toList()) /** @@ -81,6 +85,7 @@ fun vectorOf(range: ULongRange): Vector = Vector(range.toList()) * ``` * @since 1.1.0 */ +@JvmSynthetic fun vectorOf(progression: IntProgression): Vector = Vector(progression.toList()) /** @@ -92,6 +97,7 @@ fun vectorOf(progression: IntProgression): Vector = Vector(progression.toLi * ``` * @since 1.1.0 */ +@JvmSynthetic fun vectorOf(progression: UIntProgression): Vector = Vector(progression.toList()) /** @@ -103,6 +109,7 @@ fun vectorOf(progression: UIntProgression): Vector = Vector(progression.to * ``` * @since 1.1.0 */ +@JvmSynthetic fun vectorOf(progression: LongProgression): Vector = Vector(progression.toList()) /** @@ -114,6 +121,7 @@ fun vectorOf(progression: LongProgression): Vector = Vector(progression.to * ``` * @since 1.1.0 */ +@JvmSynthetic fun vectorOf(progression: ULongProgression): Vector = Vector(progression.toList()) /** @@ -125,6 +133,7 @@ fun vectorOf(progression: ULongProgression): Vector = Vector(progression. * ``` * @since 1.1.0 */ +@JvmSynthetic fun vectorOf(range: CharRange): Vector = Vector(range.toList()) /** @@ -136,6 +145,7 @@ fun vectorOf(range: CharRange): Vector = Vector(range.toList()) * ``` * @since 1.1.0 */ +@JvmSynthetic fun vectorOf(progression: CharProgression): Vector = Vector(progression.toList()) /** diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/color/Color.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/color/Color.kt index 56ba4721..b5bbc2b9 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/color/Color.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/color/Color.kt @@ -12,6 +12,7 @@ import java.awt.Color * ``` * @since 1.1.0 */ +@get:JvmName("rgbToHex") inline val Int.rgbToHex: String get() = "#%06X".format(-0x1 and this) @@ -24,6 +25,7 @@ inline val Int.rgbToHex: String * ``` * @since 1.1.0 */ +@get:JvmSynthetic inline val Triple.rgbToHex: String get() { val r = "%02X".format(-0x1 and first.toInt()) @@ -43,6 +45,7 @@ inline val Triple.rgbToHex: String * @since 1.1.0 * @return [Triple] of red, green and blue values. */ +@get:JvmSynthetic inline val String.hexToRgb: Triple? get() = tryCatchNull { var name = this diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/Calendar.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/Calendar.kt index 1e053d0c..37f4f723 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/Calendar.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/Calendar.kt @@ -1,5 +1,3 @@ -@file:Suppress("EXTENSION_SHADOWED_BY_MEMBER") - package com.parsuomash.affogato.core.ktx.datetime import com.parsuomash.affogato.core.ktx.tryCatchNull @@ -11,54 +9,82 @@ import kotlinx.datetime.LocalDateTime import kotlinx.datetime.LocalTime /** @since 1.1.0 */ -inline val Calendar.year: Int get() = get(Calendar.YEAR) +@get:JvmSynthetic +inline val Calendar.year: Int + get() = get(Calendar.YEAR) /** @since 1.1.0 */ -inline val Calendar.month: Int get() = get(Calendar.MONTH) +@get:JvmSynthetic +inline val Calendar.month: Int + get() = get(Calendar.MONTH) /** @since 1.1.0 */ -inline val Calendar.dayOfYear: Int get() = get(Calendar.DAY_OF_YEAR) +@get:JvmSynthetic +inline val Calendar.dayOfYear: Int + get() = get(Calendar.DAY_OF_YEAR) /** @since 1.1.0 */ -inline val Calendar.dayOfMonth: Int get() = get(Calendar.DAY_OF_MONTH) +@get:JvmSynthetic +inline val Calendar.dayOfMonth: Int + get() = get(Calendar.DAY_OF_MONTH) /** @since 1.1.0 */ -inline val Calendar.dayOfWeek: Int get() = get(Calendar.DAY_OF_WEEK) +@get:JvmSynthetic +inline val Calendar.dayOfWeek: Int + get() = get(Calendar.DAY_OF_WEEK) /** @since 1.1.0 */ -inline val Calendar.dayOfWeekInMonth: Int get() = get(Calendar.DAY_OF_WEEK_IN_MONTH) +@get:JvmSynthetic +inline val Calendar.dayOfWeekInMonth: Int + get() = get(Calendar.DAY_OF_WEEK_IN_MONTH) /** @since 1.1.0 */ -inline val Calendar.hour: Int get() = get(Calendar.HOUR) +@get:JvmSynthetic +inline val Calendar.hour: Int + get() = get(Calendar.HOUR) /** @since 1.1.0 */ -inline val Calendar.hourOfDay: Int get() = get(Calendar.HOUR_OF_DAY) +@get:JvmSynthetic +inline val Calendar.hourOfDay: Int + get() = get(Calendar.HOUR_OF_DAY) /** @since 1.1.0 */ -inline val Calendar.minute: Int get() = get(Calendar.MINUTE) +@get:JvmSynthetic +inline val Calendar.minute: Int + get() = get(Calendar.MINUTE) /** @since 1.1.0 */ -inline val Calendar.second: Int get() = get(Calendar.SECOND) +@get:JvmSynthetic +inline val Calendar.second: Int + get() = get(Calendar.SECOND) /** @since 1.1.0 */ -inline val Calendar.millisecond: Int get() = get(Calendar.MILLISECOND) +@get:JvmSynthetic +inline val Calendar.millisecond: Int + get() = get(Calendar.MILLISECOND) /** @since 1.1.0 */ -inline val Calendar.weekOfYear: Int get() = get(Calendar.WEEK_OF_YEAR) +@get:JvmSynthetic +inline val Calendar.weekOfYear: Int + get() = get(Calendar.WEEK_OF_YEAR) /** @since 1.1.0 */ -inline val Calendar.weekOfMonth: Int get() = get(Calendar.WEEK_OF_MONTH) +@get:JvmSynthetic +inline val Calendar.weekOfMonth: Int + get() = get(Calendar.WEEK_OF_MONTH) /** * Convert [Long] to [Calendar]. * @since 1.1.0 */ -fun Long.toCalendar(): Calendar = Calendar.getInstance().apply { time = Date(this@toCalendar) } +fun Long.toCalendar(): Calendar = + Calendar.getInstance().apply { time = Date(this@toCalendar) } /** * Convert [Duration] to [Calendar]. * @since 1.1.0 */ +@JvmSynthetic fun Duration.toCalendar(): Calendar = Calendar.getInstance().apply { time = Date(inWholeMilliseconds) } @@ -66,24 +92,30 @@ fun Duration.toCalendar(): Calendar = * Convert [Calendar] to [Date]. * @since 1.1.0 */ -fun Calendar.toDate(): Date = time +fun Calendar.toDate(): Date = + time /** * Convert [Calendar] to [LocalDate]. * @since 1.1.0 */ -fun Calendar.toLocalDate(): LocalDate = LocalDate(year, month + 1, dayOfMonth) +@JvmSynthetic +fun Calendar.toLocalDate(): LocalDate = + LocalDate(year, month + 1, dayOfMonth) /** * Convert [Calendar] to [LocalTime]. * @since 1.1.0 */ -fun Calendar.toLocalTime(): LocalTime = LocalTime(hourOfDay, minute, second) +@JvmSynthetic +fun Calendar.toLocalTime(): LocalTime = + LocalTime(hourOfDay, minute, second) /** * Convert [Calendar] to [LocalDateTime]. * @since 1.1.0 */ +@JvmSynthetic fun Calendar.toLocalDateTime(): LocalDateTime = LocalDateTime(year, month + 1, dayOfMonth, hourOfDay, minute, second) @@ -91,33 +123,40 @@ fun Calendar.toLocalDateTime(): LocalDateTime = * Two days are considered to be the same if they have the same day. * @since 1.1.0 */ -infix fun Calendar.isSameDay(date: Calendar): Boolean = dayOfYear == date.dayOfYear +infix fun Calendar.isSameDay(date: Calendar): Boolean = + dayOfYear == date.dayOfYear /** * Adds the other value to this value. * @since 1.1.0 */ -operator fun Calendar.plus(other: Calendar): Calendar = (time + other.time).toCalendar() +@JvmSynthetic +operator fun Calendar.plus(other: Calendar): Calendar = + (time + other.time).toCalendar() /** * Subtracts the other value from this value. * @since 1.1.0 */ -operator fun Calendar.minus(other: Calendar): Calendar = (time - other.time).toCalendar() +@JvmSynthetic +operator fun Calendar.minus(other: Calendar): Calendar = + (time - other.time).toCalendar() /** * Adds the [Duration] value to this [Calendar]. * @since 1.1.0 */ -operator - -fun Calendar.plus(other: Duration): Calendar = this + other.toCalendar() +@JvmSynthetic +operator fun Calendar.plus(other: Duration): Calendar = + this + other.toCalendar() /** * Subtracts the [Duration] value from this [Calendar]. * @since 1.1.0 */ -operator fun Calendar.minus(other: Duration): Calendar = this - other.toCalendar() +@JvmSynthetic +operator fun Calendar.minus(other: Duration): Calendar = + this - other.toCalendar() /** * Produce a Calendar from the given strings value and [pattern]. @@ -127,6 +166,7 @@ operator fun Calendar.minus(other: Duration): Calendar = this - other.toCalendar * @return A Calendar parsed from the string. * @see SimpleDateFormat */ +@JvmOverloads fun String.toCalendar(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Calendar { simpleDateFormat.applyPattern(pattern) return simpleDateFormat.parse(this).toCalendar() @@ -138,6 +178,7 @@ fun String.toCalendar(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Calenda * @return A nullable Calendar parsed from the string. * @see SimpleDateFormat */ +@JvmOverloads fun String.toCalendarOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Calendar? = tryCatchNull { simpleDateFormat.applyPattern(pattern) diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/Date.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/Date.kt index bd0aaae3..c9dc5858 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/Date.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/Date.kt @@ -17,7 +17,8 @@ import kotlinx.datetime.LocalTime * ``` * @since 1.1.0 */ -fun Long.toDate(): Date = Date(this) +fun Long.toDate(): Date = + Date(this) /** * Convert [Duration] to [Date]. @@ -28,12 +29,15 @@ fun Long.toDate(): Date = Date(this) * ``` * @since 1.1.0 */ -fun Duration.toDate(): Date = Date(inWholeMilliseconds) +@JvmSynthetic +fun Duration.toDate(): Date = + Date(inWholeMilliseconds) /** * Convert [Date] to [LocalDate]. * @since 1.1.0 */ +@JvmSynthetic fun Date.toLocalDate(): LocalDate { val calendar = Calendar.getInstance().apply { time = this@toLocalDate } return LocalDate(calendar.year, calendar.month + 1, calendar.dayOfMonth) @@ -43,6 +47,7 @@ fun Date.toLocalDate(): LocalDate { * Convert [Date] to [LocalTime]. * @since 1.1.0 */ +@JvmSynthetic fun Date.toLocalTime(): LocalTime { val calendar = Calendar.getInstance().apply { time = this@toLocalTime } return LocalTime(calendar.hourOfDay, calendar.minute, calendar.second) @@ -52,6 +57,7 @@ fun Date.toLocalTime(): LocalTime { * Convert [Date] to [LocalDateTime]. * @since 1.1.0 */ +@JvmSynthetic fun Date.toLocalDateTime(): LocalDateTime { val calendar = Calendar.getInstance().apply { time = this@toLocalDateTime } with(calendar) { @@ -63,7 +69,8 @@ fun Date.toLocalDateTime(): LocalDateTime { * Convert [Date] to [Calendar]. * @since 1.1.0 */ -fun Date.toCalendar(): Calendar = Calendar.getInstance().apply { time = this@toCalendar } +fun Date.toCalendar(): Calendar = + Calendar.getInstance().apply { time = this@toCalendar } /** * Two days are considered to be the same if they have the same day. @@ -83,25 +90,33 @@ infix fun Date.isSameDay(date: Date): Boolean = * Adds the other value to this value. * @since 1.1.0 */ -operator fun Date.plus(other: Date): Date = Date(time + other.time) +@JvmSynthetic +operator fun Date.plus(other: Date): Date = + Date(time + other.time) /** * Subtracts the other value from this value. * @since 1.1.0 */ -operator fun Date.minus(other: Date): Date = Date(time - other.time) +@JvmSynthetic +operator fun Date.minus(other: Date): Date = + Date(time - other.time) /** * Adds the [Duration] value to this [Date]. * @since 1.1.0 */ -operator fun Date.plus(other: Duration): Date = Date(time + other.inWholeMilliseconds) +@JvmSynthetic +operator fun Date.plus(other: Duration): Date = + Date(time + other.inWholeMilliseconds) /** * Subtracts the [Duration] value from this [Date]. * @since 1.1.0 */ -operator fun Date.minus(other: Duration): Date = Date(time - other.inWholeMilliseconds) +@JvmSynthetic +operator fun Date.minus(other: Duration): Date = + Date(time - other.inWholeMilliseconds) /** * Produce a date from the given strings value and [pattern]. @@ -118,6 +133,7 @@ operator fun Date.minus(other: Duration): Date = Date(time - other.inWholeMillis * @return A Date parsed from the string. * @see SimpleDateFormat */ +@JvmOverloads fun String.toDate(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Date { simpleDateFormat.applyPattern(pattern) return simpleDateFormat.parse(this) @@ -136,6 +152,7 @@ fun String.toDate(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Date { * @return A nullable Date parsed from the string. * @see SimpleDateFormat */ +@JvmOverloads fun String.toDateOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Date? = tryCatchNull { simpleDateFormat.applyPattern(pattern) simpleDateFormat.parse(this) diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/Instant.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/Instant.kt index ad6097f3..75aa48de 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/Instant.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/Instant.kt @@ -18,18 +18,23 @@ import kotlinx.datetime.toLocalDateTime * ``` * @since 1.1.0 */ -fun Long.toInstant(): Instant = Instant.fromEpochMilliseconds(this) +@JvmSynthetic +fun Long.toInstant(): Instant = + Instant.fromEpochMilliseconds(this) /** * Convert [Instant] to [Date]. * @since 1.1.0 */ -fun Instant.toDate(): Date = Date(toEpochMilliseconds()) +@JvmSynthetic +fun Instant.toDate(): Date = + Date(toEpochMilliseconds()) /** * Convert [Instant] to [Calendar]. * @since 1.1.0 */ +@JvmSynthetic fun Instant.toCalendar(): Calendar = Calendar.getInstance().apply { time = Date(toEpochMilliseconds()) } @@ -37,6 +42,7 @@ fun Instant.toCalendar(): Calendar = * Convert [Instant] to [LocalDate]. * @since 1.1.0 */ +@JvmSynthetic fun Instant.toLocalDate(timeZone: TimeZone = TimeZone.currentSystemDefault()): LocalDate = toLocalDateTime(timeZone).date @@ -44,6 +50,7 @@ fun Instant.toLocalDate(timeZone: TimeZone = TimeZone.currentSystemDefault()): L * Convert [Instant] to [LocalTime]. * @since 1.1.0 */ +@JvmSynthetic fun Instant.toLocalTime(timeZone: TimeZone = TimeZone.currentSystemDefault()): LocalTime = toLocalDateTime(timeZone).time @@ -59,6 +66,7 @@ fun Instant.toLocalTime(timeZone: TimeZone = TimeZone.currentSystemDefault()): L * @since 1.1.0 * @see now */ +@JvmSynthetic infix fun Instant.isSameDay(date: Instant): Boolean = toLocalDate().dayOfYear == date.toLocalDate().dayOfYear @@ -77,6 +85,7 @@ infix fun Instant.isSameDay(date: Instant): Boolean = * @return An Instant parsed from the string. * @see SimpleDateFormat */ +@JvmSynthetic fun String.toInstant(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Instant { simpleDateFormat.applyPattern(pattern) val date = simpleDateFormat.parse(this) @@ -96,6 +105,7 @@ fun String.toInstant(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Instant * @return A nullable Instant parsed from the string. * @see SimpleDateFormat */ +@JvmSynthetic fun String.toInstantOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Instant? = tryCatchNull { simpleDateFormat.applyPattern(pattern) @@ -115,6 +125,7 @@ fun String.toInstantOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): In * @return The formatted date-time string. * @see SimpleDateFormat */ +@JvmSynthetic fun Instant.format(pattern: String): String { simpleDateFormat.applyPattern(pattern) return simpleDateFormat.format(toDate()) @@ -143,6 +154,7 @@ fun Instant.format(pattern: String): String { ), level = DeprecationLevel.WARNING ) +@JvmSynthetic fun Instant.toString(format: String): String { simpleDateFormat.applyPattern(format) return simpleDateFormat.format(toDate()) diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/LocalDate.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/LocalDate.kt index ee3cd8c9..d0f4ebc6 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/LocalDate.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/LocalDate.kt @@ -22,6 +22,7 @@ import kotlinx.datetime.todayIn * ``` * @since 1.1.0 */ +@JvmSynthetic fun Long.toLocalDate(): LocalDate { val calendar = Calendar.getInstance().apply { time = Date(this@toLocalDate) } return LocalDate(calendar.year, calendar.month + 1, calendar.dayOfMonth) @@ -31,6 +32,7 @@ fun Long.toLocalDate(): LocalDate { * Convert [LocalDate] to [Date]. * @since 1.1.0 */ +@JvmSynthetic fun LocalDate.toDate(): Date = Calendar.getInstance().apply { set(this@toDate.year, this@toDate.monthNumber - 1, this@toDate.dayOfMonth, 0, 0, 0) set(Calendar.MILLISECOND, 0) @@ -40,12 +42,15 @@ fun LocalDate.toDate(): Date = Calendar.getInstance().apply { * Convert [LocalDate] to [LocalDateTime]. * @since 1.1.0 */ -fun LocalDate.toLocalDateTime(): LocalDateTime = LocalDateTime(year, month, dayOfMonth, 0, 0, 0) +@JvmSynthetic +fun LocalDate.toLocalDateTime(): LocalDateTime = + LocalDateTime(year, month, dayOfMonth, 0, 0, 0) /** * Convert [LocalDate] to [Calendar]. * @since 1.1.0 */ +@JvmSynthetic fun LocalDate.toCalendar(): Calendar = Calendar.getInstance().apply { set(this@toCalendar.year, this@toCalendar.monthNumber - 1, this@toCalendar.dayOfMonth, 0, 0, 0) set(Calendar.MILLISECOND, 0) @@ -56,6 +61,7 @@ fun LocalDate.toCalendar(): Calendar = Calendar.getInstance().apply { * @since 1.1.0 * @see Clock */ +@JvmSynthetic fun LocalDate.Companion.now(timeZone: TimeZone = TimeZone.currentSystemDefault()): LocalDate = Clock.System.todayIn(timeZone) @@ -71,12 +77,15 @@ fun LocalDate.Companion.now(timeZone: TimeZone = TimeZone.currentSystemDefault() * @since 1.1.0 * @see now */ -infix fun LocalDate.isSameDay(date: LocalDate): Boolean = dayOfYear == date.dayOfYear +@JvmSynthetic +infix fun LocalDate.isSameDay(date: LocalDate): Boolean = + dayOfYear == date.dayOfYear /** * Adds the other value to this value. * @since 1.1.0 */ +@JvmSynthetic operator fun LocalDate.plus(duration: Duration): LocalDate = plus(duration.inWholeDays, DateTimeUnit.DAY) @@ -84,6 +93,7 @@ operator fun LocalDate.plus(duration: Duration): LocalDate = * Subtracts the other value from this value. * @since 1.1.0 */ +@JvmSynthetic operator fun LocalDate.minus(duration: Duration): LocalDate = minus(duration.inWholeDays, DateTimeUnit.DAY) @@ -102,6 +112,7 @@ operator fun LocalDate.minus(duration: Duration): LocalDate = * @return A LocalDate parsed from the string. * @see SimpleDateFormat */ +@JvmSynthetic fun String.toLocalDate(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): LocalDate { simpleDateFormat.applyPattern(pattern) return simpleDateFormat.parse(this).toLocalDate() @@ -120,6 +131,7 @@ fun String.toLocalDate(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): LocalD * @return A nullable LocalDate parsed from the string. * @see SimpleDateFormat */ +@JvmSynthetic fun String.toLocalDateOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): LocalDate? = tryCatchNull { simpleDateFormat.applyPattern(pattern) @@ -138,6 +150,7 @@ fun String.toLocalDateOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): * @return The formatted date-time string. * @see SimpleDateFormat */ +@JvmSynthetic fun LocalDate.format(pattern: String): String { simpleDateFormat.applyPattern(pattern) return simpleDateFormat.format(toDate()) @@ -166,6 +179,7 @@ fun LocalDate.format(pattern: String): String { ), level = DeprecationLevel.WARNING ) +@JvmSynthetic fun LocalDate.toString(format: String): String { simpleDateFormat.applyPattern(format) return simpleDateFormat.format(toDate()) diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/LocalDateTime.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/LocalDateTime.kt index fb46bb58..0ffb73c2 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/LocalDateTime.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/LocalDateTime.kt @@ -21,6 +21,7 @@ import kotlinx.datetime.toLocalDateTime * ``` * @since 1.1.0 */ +@JvmSynthetic fun Long.toLocalDateTime(): LocalDateTime { val calendar = Calendar.getInstance().apply { time = Date(this@toLocalDateTime) } with(calendar) { @@ -32,24 +33,31 @@ fun Long.toLocalDateTime(): LocalDateTime { * Convert [LocalDateTime] to [Date]. * @since 1.1.0 */ -fun LocalDateTime.toDate(): Date = toCalendar().time +@JvmSynthetic +fun LocalDateTime.toDate(): Date = + toCalendar().time /** * Convert [LocalDateTime] to [LocalDate]. * @since 1.1.0 */ -fun LocalDateTime.toLocalDate(): LocalDate = date +@JvmSynthetic +fun LocalDateTime.toLocalDate(): LocalDate = + date /** * Convert [LocalDateTime] to [LocalTime]. * @since 1.1.0 */ -fun LocalDateTime.toLocalTime(): LocalTime = time +@JvmSynthetic +fun LocalDateTime.toLocalTime(): LocalTime = + time /** * Convert [LocalDateTime] to [Calendar]. * @since 1.1.0 */ +@JvmSynthetic fun LocalDateTime.toCalendar(): Calendar = Calendar.getInstance().apply { set( this@toCalendar.year, @@ -67,6 +75,7 @@ fun LocalDateTime.toCalendar(): Calendar = Calendar.getInstance().apply { * @since 1.1.0 * @see Clock */ +@JvmSynthetic fun LocalDateTime.Companion.now( timeZone: TimeZone = TimeZone.currentSystemDefault() ): LocalDateTime = Clock.System.now().toLocalDateTime(timeZone) @@ -75,12 +84,15 @@ fun LocalDateTime.Companion.now( * Two days are considered to be the same if they have the same day. * @since 1.1.0 */ -infix fun LocalDateTime.isSameDay(date: LocalDateTime): Boolean = dayOfYear == date.dayOfYear +@JvmSynthetic +infix fun LocalDateTime.isSameDay(date: LocalDateTime): Boolean = + dayOfYear == date.dayOfYear /** * Adds the other value to this value. * @since 1.1.0 */ +@JvmSynthetic operator fun LocalDateTime.plus(duration: Duration): LocalDateTime { val timeZone = TimeZone.currentSystemDefault() return (toInstant(timeZone) + duration).toLocalDateTime(timeZone) @@ -90,6 +102,7 @@ operator fun LocalDateTime.plus(duration: Duration): LocalDateTime { * Subtracts the other value from this value. * @since 1.1.0 */ +@JvmSynthetic operator fun LocalDateTime.minus(duration: Duration): LocalDateTime { val timeZone = TimeZone.currentSystemDefault() return (toInstant(timeZone) - duration).toLocalDateTime(timeZone) @@ -110,6 +123,7 @@ operator fun LocalDateTime.minus(duration: Duration): LocalDateTime { * @return A LocalDateTime parsed from the string. * @see SimpleDateFormat */ +@JvmSynthetic fun String.toLocalDateTime(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): LocalDateTime { simpleDateFormat.applyPattern(pattern) return simpleDateFormat.parse(this).toLocalDateTime() @@ -128,6 +142,7 @@ fun String.toLocalDateTime(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): Lo * @return A nullable LocalDateTime parsed from the string. * @see SimpleDateFormat */ +@JvmSynthetic fun String.toLocalDateTimeOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): LocalDateTime? = tryCatchNull { simpleDateFormat.applyPattern(pattern) @@ -146,6 +161,7 @@ fun String.toLocalDateTimeOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy * @return The formatted date-time string. * @see SimpleDateFormat */ +@JvmSynthetic fun LocalDateTime.format(pattern: String): String { simpleDateFormat.applyPattern(pattern) return simpleDateFormat.format(toDate()) @@ -174,6 +190,7 @@ fun LocalDateTime.format(pattern: String): String { ), level = DeprecationLevel.WARNING ) +@JvmSynthetic fun LocalDateTime.toString(format: String): String { simpleDateFormat.applyPattern(format) return simpleDateFormat.format(toDate()) diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/LocalTime.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/LocalTime.kt index 538c52e5..fc0cdb6b 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/LocalTime.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/LocalTime.kt @@ -18,6 +18,7 @@ import kotlinx.datetime.toLocalDateTime * ``` * @since 1.1.0 */ +@JvmSynthetic fun Long.toLocalTime(): LocalTime { val calendar = Calendar.getInstance().apply { time = Date(this@toLocalTime) } return LocalTime(calendar.hourOfDay, calendar.minute, calendar.second) @@ -27,6 +28,7 @@ fun Long.toLocalTime(): LocalTime { * Convert [LocalTime] to [Date]. * @since 1.1.0 */ +@JvmSynthetic fun LocalTime.toDate(): Date = Calendar.getInstance().apply { set(0, 0, 0, this@toDate.hour, this@toDate.minute, this@toDate.second) set(Calendar.MILLISECOND, 0) @@ -36,6 +38,7 @@ fun LocalTime.toDate(): Date = Calendar.getInstance().apply { * Convert [LocalTime] to [Calendar]. * @since 1.1.0 */ +@JvmSynthetic fun LocalTime.toCalendar(): Calendar = Calendar.getInstance().apply { set(0, 0, 0, this@toCalendar.hour, this@toCalendar.minute, this@toCalendar.second) set(Calendar.MILLISECOND, 0) @@ -46,6 +49,7 @@ fun LocalTime.toCalendar(): Calendar = Calendar.getInstance().apply { * @since 1.1.0 * @see Clock */ +@JvmSynthetic fun LocalTime.Companion.now( timeZone: TimeZone = TimeZone.currentSystemDefault() ): LocalTime = Clock.System.now().toLocalDateTime(timeZone).time @@ -54,6 +58,7 @@ fun LocalTime.Companion.now( * Adds the other value to this value. * @since 1.1.0 */ +@JvmSynthetic operator fun LocalTime.plus(duration: Duration): LocalTime = LocalTime.fromNanosecondOfDay(toNanosecondOfDay() + duration.inWholeNanoseconds) @@ -61,6 +66,7 @@ operator fun LocalTime.plus(duration: Duration): LocalTime = * Subtracts the other value from this value. * @since 1.1.0 */ +@JvmSynthetic operator fun LocalTime.minus(duration: Duration): LocalTime = LocalTime.fromNanosecondOfDay(toNanosecondOfDay() - duration.inWholeNanoseconds) @@ -79,6 +85,7 @@ operator fun LocalTime.minus(duration: Duration): LocalTime = * @return A LocalTime parsed from the string. * @see SimpleDateFormat */ +@JvmSynthetic fun String.toLocalTime(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): LocalTime { simpleDateFormat.applyPattern(pattern) return simpleDateFormat.parse(this).toLocalTime() @@ -97,6 +104,7 @@ fun String.toLocalTime(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): LocalT * @return A nullable LocalTime parsed from the string. * @see SimpleDateFormat */ +@JvmSynthetic fun String.toLocalTimeOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): LocalTime? = tryCatchNull { simpleDateFormat.applyPattern(pattern) @@ -116,6 +124,7 @@ fun String.toLocalTimeOrNull(pattern: String = "EEE MMM dd HH:mm:ss zzz yyyy"): * @return The formatted date-time string. * @see SimpleDateFormat */ +@JvmSynthetic fun LocalTime.format(pattern: String): String { simpleDateFormat.applyPattern(pattern) return simpleDateFormat.format(toDate()) @@ -145,6 +154,7 @@ fun LocalTime.format(pattern: String): String { ), level = DeprecationLevel.WARNING ) +@JvmSynthetic fun LocalTime.toString(format: String): String { simpleDateFormat.applyPattern(format) return simpleDateFormat.format(toDate()) diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/SimpleDateFormatter.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/SimpleDateFormat.kt similarity index 84% rename from affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/SimpleDateFormatter.kt rename to affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/SimpleDateFormat.kt index b9156b21..302cbaa8 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/SimpleDateFormatter.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/datetime/SimpleDateFormat.kt @@ -2,5 +2,5 @@ package com.parsuomash.affogato.core.ktx.datetime import java.text.SimpleDateFormat -@Suppress("SimpleDateFormat") +@get:JvmSynthetic internal val simpleDateFormat: SimpleDateFormat by lazy { SimpleDateFormat() } diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/math/BigDecimal.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/math/BigDecimal.kt index 43f652b0..c9c6420b 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/math/BigDecimal.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/math/BigDecimal.kt @@ -7,6 +7,7 @@ import java.math.BigInteger * Returns the value of this [Int] number as a [BigDecimal]. * @since 1.1.0 */ +@get:JvmSynthetic inline val Int.BD: BigDecimal get() = BigDecimal.valueOf(this.toLong()) @@ -14,6 +15,7 @@ inline val Int.BD: BigDecimal * Returns the value of this [Long] number as a [BigDecimal]. * @since 1.1.0 */ +@get:JvmSynthetic inline val Long.BD: BigDecimal get() = BigDecimal.valueOf(this) @@ -21,6 +23,7 @@ inline val Long.BD: BigDecimal * Returns the value of this [Float] number as a [BigDecimal]. * @since 1.1.0 */ +@get:JvmSynthetic inline val Float.BD: BigDecimal get() = BigDecimal.valueOf(this.toDouble()) @@ -28,6 +31,7 @@ inline val Float.BD: BigDecimal * Returns the value of this [Double] number as a [BigDecimal]. * @since 1.1.0 */ +@get:JvmSynthetic inline val Double.BD: BigDecimal get() = BigDecimal.valueOf(this) @@ -35,5 +39,6 @@ inline val Double.BD: BigDecimal * Returns the value of this [BigInteger] number as a [BigDecimal]. * @since 1.1.0 */ +@get:JvmSynthetic inline val BigInteger.BD: BigDecimal get() = BigDecimal(this) diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/math/BigInteger.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/math/BigInteger.kt index 60ca3ba7..5899d7cb 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/math/BigInteger.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/math/BigInteger.kt @@ -6,6 +6,7 @@ import java.math.BigInteger * Returns the value of this [Int] number as a [BigInteger]. * @since 1.1.0 */ +@get:JvmSynthetic inline val Int.BI: BigInteger get() = BigInteger.valueOf(this.toLong()) @@ -13,5 +14,6 @@ inline val Int.BI: BigInteger * Returns the value of this [Long] number as a [BigInteger]. * @since 1.1.0 */ +@get:JvmSynthetic inline val Long.BI: BigInteger get() = BigInteger.valueOf(this) diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/math/Math.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/math/Math.kt index 2f2f290f..1d81b5f7 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/math/Math.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/math/Math.kt @@ -42,6 +42,7 @@ inline val Number.isEven: Boolean * ``` * @since 1.1.0 */ +@get:JvmName("asDegrees") inline val Number.asDegrees: Float get() = toFloat() * (180F / PI).toFloat() @@ -54,6 +55,7 @@ inline val Number.asDegrees: Float * ``` * @since 1.1.0 */ +@get:JvmName("asRadians") inline val Number.asRadians: Float get() = toFloat() * (PI / 180F).toFloat() @@ -69,6 +71,7 @@ inline val Number.asRadians: Float * @since 1.1.0 * @see kotlin.math.round */ +@JvmOverloads fun round(number: Float, digits: Int = 0): Float { return if (digits == 0) { round(number) @@ -89,6 +92,7 @@ fun round(number: Float, digits: Int = 0): Float { * @since 1.1.0 * @see kotlin.math.round */ +@JvmOverloads fun round(number: Double, digits: Int = 0): Double { return if (digits == 0) { round(number) @@ -109,7 +113,8 @@ fun round(number: Double, digits: Int = 0): Double { * @since 1.1.0 * @see kotlin.math.round */ -@JvmName("roundEx") +@JvmName("roundExtension") +@JvmSynthetic fun Float.round(digits: Int = 0): Float { return if (digits == 0) { round(this) @@ -130,7 +135,8 @@ fun Float.round(digits: Int = 0): Float { * @since 1.1.0 * @see kotlin.math.round */ -@JvmName("roundEx") +@JvmName("roundExtension") +@JvmSynthetic fun Double.round(digits: Int = 0): Double { return if (digits == 0) { round(this) @@ -148,6 +154,7 @@ fun Double.round(digits: Int = 0): Double { * ``` * @since 1.1.0 */ +@JvmOverloads tailrec fun fact(n: Long, run: Long = 1): Long = if (n == 1L) run else fact(n - 1, run * n) @@ -160,6 +167,7 @@ tailrec fun fact(n: Long, run: Long = 1): Long = * ``` * @since 1.1.0 */ +@JvmOverloads tailrec fun fib(n: Long, first: Long = 0, second: Long = 1): Long = if (n == 0L) first else fib(n - 1, second, first + second) @@ -187,6 +195,7 @@ inline infix fun T.perc(percentage: T): Double = * @since 1.1.0 * @see round */ +@JvmSynthetic inline infix fun T.almostEq(other: T): Boolean { if (this == other) return false return round(toDouble()) == round(other.toDouble()) diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/operations/Operations.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/operations/Operations.kt index 2115e123..2cef94a6 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/operations/Operations.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/operations/Operations.kt @@ -15,6 +15,7 @@ import com.parsuomash.affogato.core.ktx.tryCatchNull * @throws IllegalArgumentException when n < 0. * @see String.repeat */ +@JvmSynthetic operator fun String.times(n: Int): String = repeat(n) /** @@ -30,6 +31,7 @@ operator fun String.times(n: Int): String = repeat(n) * @throws IllegalArgumentException when n < 0. * @see times */ +@JvmSynthetic operator fun Char.times(n: Int): String = toString() * n /** @@ -46,6 +48,7 @@ operator fun Char.times(n: Int): String = toString() * n * @see Boolean.not * @see Boolean.or */ +@JvmSynthetic infix fun Boolean.nor(other: Boolean): Boolean = (this or other).not() /** @@ -62,6 +65,7 @@ infix fun Boolean.nor(other: Boolean): Boolean = (this or other).not() * @see Boolean.not * @see Boolean.and */ +@JvmSynthetic infix fun Boolean.nand(other: Boolean): Boolean = (this and other).not() /** @@ -78,6 +82,7 @@ infix fun Boolean.nand(other: Boolean): Boolean = (this and other).not() * @see Boolean.not * @see Boolean.xor */ +@JvmSynthetic infix fun Boolean.xnor(other: Boolean): Boolean = (this xor other).not() /** @@ -91,6 +96,7 @@ infix fun Boolean.xnor(other: Boolean): Boolean = (this xor other).not() * @since 1.1.0 * @see inv */ +@JvmSynthetic operator fun Int.not(): Int = inv() /** @@ -106,6 +112,7 @@ operator fun Int.not(): Int = inv() * @since 1.1.0 * @see Int.or */ +@JvmSynthetic infix fun Int.nor(other: Int): Int = (this or other).not() /** @@ -121,6 +128,7 @@ infix fun Int.nor(other: Int): Int = (this or other).not() * @since 1.1.0 * @see Int.and */ +@JvmSynthetic infix fun Int.nand(other: Int): Int = (this and other).not() /** @@ -136,6 +144,7 @@ infix fun Int.nand(other: Int): Int = (this and other).not() * @since 1.1.0 * @see Int.xor */ +@JvmSynthetic infix fun Int.xnor(other: Int): Int = (this xor other).not() /** @@ -150,6 +159,7 @@ infix fun Int.xnor(other: Int): Int = (this xor other).not() * @since 1.1.0 * @throws IllegalArgumentException when n != 0 or n != 1. */ +@JvmSynthetic fun Int.toBoolean(): Boolean = when (this) { 1 -> true 0 -> false @@ -167,6 +177,7 @@ fun Int.toBoolean(): Boolean = when (this) { * ``` * @since 1.1.0 */ +@JvmSynthetic fun Int.toBooleanOrNull(): Boolean? = tryCatchNull { toBoolean() } /** @@ -179,4 +190,5 @@ fun Int.toBooleanOrNull(): Boolean? = tryCatchNull { toBoolean() } * ``` * @since 1.1.0 */ +@JvmSynthetic fun Boolean.toInt(): Int = if (this) 1 else 0 diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/random/Random.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/random/Random.kt index 998d1b84..439a6b10 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/random/Random.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/random/Random.kt @@ -16,6 +16,7 @@ import kotlin.random.nextULong * @throws IllegalArgumentException if progression is empty. * @see Random.nextInt */ +@JvmSynthetic fun Random.nextInt(progression: IntProgression): Int { val first = progression.last val last = progression.last @@ -31,6 +32,7 @@ fun Random.nextInt(progression: IntProgression): Int { * @throws IllegalArgumentException if progression is empty. * @see Random.nextUInt */ +@JvmSynthetic fun Random.nextUInt(progression: UIntProgression): UInt { val first = progression.last val last = progression.last @@ -46,6 +48,7 @@ fun Random.nextUInt(progression: UIntProgression): UInt { * @throws IllegalArgumentException if progression is empty. * @see Random.nextLong */ +@JvmSynthetic fun Random.nextLong(progression: LongProgression): Long { val first = progression.last val last = progression.last @@ -61,6 +64,7 @@ fun Random.nextLong(progression: LongProgression): Long { * @throws IllegalArgumentException if progression is empty. * @see Random.nextULong */ +@JvmSynthetic fun Random.nextULong(progression: ULongProgression): ULong { val first = progression.last val last = progression.last @@ -79,7 +83,7 @@ fun Random.nextULong(progression: ULongProgression): ULong { * @throws NoSuchElementException - if this array is empty. * @see Array.random */ -@JvmName("choiceVars") +@JvmName("choiceVararg") fun Random.choice(vararg elements: T): T = elements.random(this) /** @@ -93,7 +97,8 @@ fun Random.choice(vararg elements: T): T = elements.random(this) * @throws NoSuchElementException - if this array is empty. * @see Array.random */ -fun Random.choice(array: Array): T = array.random(this) +fun Random.choice(array: Array): T = + array.random(this) /** * Returns a random element from this collection using the specified source of randomness. @@ -106,7 +111,8 @@ fun Random.choice(array: Array): T = array.random(this) * @throws NoSuchElementException - if this collection is empty. * @see Collection.random */ -fun Random.choice(collection: Collection): T = collection.random(this) +fun Random.choice(collection: Collection): T = + collection.random(this) /** * Returns a random element from this map using the specified source of randomness. @@ -133,7 +139,8 @@ inline fun Random.choice(map: Map): Pair { * @since 1.1.0 * @throws NoSuchElementException - if this map is empty. */ -inline fun Map.random(): Pair = Random.choice(this) +inline fun Map.random(): Pair = + Random.choice(this) /** * Returns a random element from this array using the specified source of randomness, @@ -147,7 +154,8 @@ inline fun Map.random(): Pair = Random.choice(this) * @since 1.1.0 * @see Array.randomOrNull */ -fun Random.choiceOrNull(array: Array): T? = array.randomOrNull(this) +fun Random.choiceOrNull(array: Array): T? = + array.randomOrNull(this) /** * Returns a random element from this collection using the specified source of randomness, @@ -175,10 +183,11 @@ fun Random.choiceOrNull(collection: Collection): T? = * ``` * @since 1.1.0 */ -inline fun Random.choiceOrNull(map: Map): Pair? = tryCatchNull { - val choice = map.keys.random(this) - Pair(choice, map[choice]!!) -} +inline fun Random.choiceOrNull(map: Map): Pair? = + tryCatchNull { + val choice = map.keys.random(this) + Pair(choice, map[choice]!!) + } /** * Returns a random element from this map using the specified source of randomness, @@ -191,7 +200,8 @@ inline fun Random.choiceOrNull(map: Map): Pair? = try * ``` * @since 1.1.0 */ -inline fun Map.randomOrNull(): Pair? = Random.choiceOrNull(this) +inline fun Map.randomOrNull(): Pair? = + Random.choiceOrNull(this) /** * Returns a random list from this array using the specified source of randomness. @@ -204,7 +214,8 @@ inline fun Map.randomOrNull(): Pair? = Random.choiceO * @return randomness list * @see Random.choice */ -@JvmName("choicesVars") +@JvmName("choicesVararg") +@JvmOverloads fun Random.choices(vararg elements: T, weights: List? = null, length: Int = 1): List { val size = elements.size require(elements.isNotEmpty()) { "Arrays is empty." } @@ -237,6 +248,7 @@ fun Random.choices(vararg elements: T, weights: List? = null, length: I * @return randomness list * @see Random.choice */ +@JvmOverloads fun Random.choices(array: Array, weights: List? = null, length: Int = 1): List { val size = array.size require(array.isNotEmpty()) { "Arrays is empty." } @@ -269,6 +281,7 @@ fun Random.choices(array: Array, weights: List? = null, length: Int * @return randomness list * @see Random.choice */ +@JvmOverloads fun Random.choices( collection: Collection, weights: List? = null, @@ -305,6 +318,7 @@ fun Random.choices( * @return randomness list * @see Random.choice */ +@JvmOverloads fun Random.choicesOrNull( array: Array, weights: List? = null, @@ -324,6 +338,7 @@ fun Random.choicesOrNull( * @return randomness list * @see Random.choice */ +@JvmOverloads fun Random.choicesOrNull( collection: Collection, weights: List? = null, diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/text/Formatter.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/text/Formatter.kt index 91ed0187..6b8092fb 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/text/Formatter.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/text/Formatter.kt @@ -49,6 +49,7 @@ fun Double.removeDecimalPart(): String { * @param pattern default pattern is comma separator. * @return format number. */ +@JvmOverloads fun Number.format(pattern: String = "#,###.##"): String { decimalFormat.applyPattern(pattern) return decimalFormat.format(this) @@ -93,6 +94,7 @@ fun Number.compactFormat(): String { * @since 1.1.0 * @return formatted credit card number. */ +@JvmOverloads fun String.formatCreditCard(separator: String = " ", separatorDigit: Int = 4): String { val preparedString = replace(" ", "").trim() return buildString { @@ -105,5 +107,7 @@ fun String.formatCreditCard(separator: String = " ", separatorDigit: Int = 4): S } } -internal val decimalFormat: DecimalFormat by lazy { DecimalFormat() } +@get:JvmSynthetic +private val decimalFormat: DecimalFormat by lazy { DecimalFormat() } + private val suffix = charArrayOf(' ', 'k', 'M', 'B', 'T', 'P', 'E') diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/text/NumberConverter.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/text/NumberConverter.kt index 3019f9ee..c306b089 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/text/NumberConverter.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/text/NumberConverter.kt @@ -21,24 +21,31 @@ object NumberConverter { private val urduNumbers = charArrayOf('۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹') /** @since 1.1.0 */ + @JvmStatic fun toArabic(value: String): String = numberConverter(value, arabicNumbers) /** @since 1.1.0 */ + @JvmStatic fun toFarsi(value: String): String = numberConverter(value, farsiNumbers) /** @since 1.1.0 */ + @JvmStatic fun toMongolian(value: String): String = numberConverter(value, mongolianNumbers) /** @since 1.1.0 */ + @JvmStatic fun toMyanmar(value: String): String = numberConverter(value, myanmarNumbers) /** @since 1.1.0 */ + @JvmStatic fun toTamil(value: String): String = numberConverter(value, tamilNumbers) /** @since 1.1.0 */ + @JvmStatic fun toThai(value: String): String = numberConverter(value, thaiNumbers) /** @since 1.1.0 */ + @JvmStatic fun toUrdu(value: String): String = numberConverter(value, urduNumbers) } diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/text/Strings.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/text/Strings.kt index 16cd3022..85888455 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/text/Strings.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/text/Strings.kt @@ -56,6 +56,7 @@ inline val String.isPersianDigit: Boolean * ``` * @since 1.1.0 */ +@get:JvmName("containsLatinLetter") inline val String.containsLatinLetter: Boolean get() = matches(Regex(".*[A-Za-z].*")) @@ -70,6 +71,7 @@ inline val String.containsLatinLetter: Boolean * ``` * @since 1.1.0 */ +@get:JvmName("containsDigit") inline val String.containsDigit: Boolean get() = matches(Regex(".*[0-9].*")) @@ -85,6 +87,7 @@ inline val String.containsDigit: Boolean * ``` * @since 1.1.0 */ +@get:JvmName("containsPersianDigit") inline val String.containsPersianDigit: Boolean get() = matches(Regex(".*[۰-۹].*")) @@ -99,6 +102,7 @@ inline val String.containsPersianDigit: Boolean * ``` * @since 1.1.0 */ +@get:JvmName("hasLettersAndDigits") inline val String.hasLettersAndDigits: Boolean get() = containsLatinLetter && containsDigit @@ -158,6 +162,7 @@ inline val String.isHttp: Boolean * @since 1.1.0 * @see URLEncoder */ +@get:JvmSynthetic inline val String.urlEncode: String get() = encodeToUrl() @@ -172,6 +177,7 @@ inline val String.urlEncode: String * @since 1.1.0 * @see URLDecoder */ +@get:JvmSynthetic inline val String.urlDecode: String get() = decodeToUrl() @@ -186,6 +192,7 @@ inline val String.urlDecode: String * ``` * @since 1.1.0 */ +@get:JvmName("lastPathComponent") inline val String.lastPathComponent: String get() { var path = this @@ -305,6 +312,7 @@ fun String?.isNotNullNotEmpty(): Boolean = * @since 1.1.0 * @see URLEncoder */ +@JvmOverloads fun String.encodeToUrl(charSet: String = "UTF-8"): String = URLEncoder.encode(this, charSet) @@ -319,6 +327,7 @@ fun String.encodeToUrl(charSet: String = "UTF-8"): String = * @since 1.1.0 * @see URLDecoder */ +@JvmOverloads fun String.decodeToUrl(charSet: String = "UTF-8"): String = URLDecoder.decode(this, charSet) @@ -355,6 +364,7 @@ fun String.capitalize() = * @throws IllegalArgumentException if n is **negative** or **zero**. * @see Collections.rotate */ +@JvmOverloads fun String.rotateLeft(n: Int = 1): String { require(n >= 1) { "n must be >= 1" } val list = this.toMutableList() @@ -374,6 +384,7 @@ fun String.rotateLeft(n: Int = 1): String { * @throws IllegalArgumentException if n is **negative** or **zero**. * @see Collections.rotate */ +@JvmOverloads fun String.rotateRight(n: Int = 1): String { require(n >= 1) { "n must be >= 1" } val list = this.toMutableList() @@ -394,6 +405,7 @@ fun String.rotateRight(n: Int = 1): String { * @see substring * @see IntRange */ +@JvmSynthetic operator fun String.get(indices: IntRange): String = substring(indices.first, indices.last + 1) @@ -409,6 +421,7 @@ operator fun String.get(indices: IntRange): String = * @see substring * @see IntRange */ +@JvmSynthetic fun String.getOrNull(indices: IntRange): String? = tryCatchNull { get(indices) } @@ -424,6 +437,7 @@ fun String.getOrNull(indices: IntRange): String? = * @see substring * @see IntRange */ +@JvmSynthetic inline fun String.getOrElse(indices: IntRange, defaultValue: () -> String): String = tryCatchElse({ defaultValue() }) { get(indices) } @@ -440,6 +454,7 @@ inline fun String.getOrElse(indices: IntRange, defaultValue: () -> String): Stri * @see substring * @see IntProgression */ +@JvmSynthetic operator fun String.get(indices: IntProgression): String = buildString { for (i in indices) append(this@get[i]) @@ -457,6 +472,7 @@ operator fun String.get(indices: IntProgression): String = * @see substring * @see IntProgression */ +@JvmSynthetic fun String.getOrNull(indices: IntProgression): String? = tryCatchNull { get(indices) } @@ -472,6 +488,7 @@ fun String.getOrNull(indices: IntProgression): String? = * @see substring * @see IntProgression */ +@JvmSynthetic inline fun String.getOrElse(indices: IntProgression, defaultValue: () -> String): String = tryCatchElse({ defaultValue() }) { get(indices) } @@ -504,6 +521,7 @@ inline fun String.hasValidLength(length: Int, block: () -> Unit) { * @since 1.1.0 * @see StringBuilder */ +@JvmSynthetic fun StringBuilder.appendSpace(): StringBuilder = append(" ") @@ -523,6 +541,7 @@ fun StringBuilder.appendSpace(): StringBuilder = * @since 1.1.0 * @see joinToString */ +@JvmOverloads fun joinWith( vararg params: T, separator: CharSequence = " ", diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/DateLimitation.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/DateLimitation.kt index 9477e3b1..8d198a7e 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/DateLimitation.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/DateLimitation.kt @@ -1,5 +1,3 @@ -@file:Suppress("unused") - package com.parsuomash.affogato.core.ktx.time /** diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/Duration.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/Duration.kt index 9a4b0b0d..cc40e43d 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/Duration.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/Duration.kt @@ -13,6 +13,7 @@ import kotlin.time.toDuration * ``` * @since 1.1.2 */ +@get:JvmSynthetic inline val Int.weeks: Duration get() = toDuration(DurationUnit.DAYS) * 7 @@ -25,6 +26,7 @@ inline val Int.weeks: Duration * ``` * @since 1.1.2 */ +@get:JvmSynthetic inline val Long.weeks: Duration get() = toDuration(DurationUnit.DAYS) * 7 @@ -41,6 +43,7 @@ inline val Long.weeks: Duration * @since 1.1.2 * @throws IllegalArgumentException if this [Double] value is `NaN`. */ +@get:JvmSynthetic inline val Double.weeks: Duration get() = toDuration(DurationUnit.DAYS) * 7 @@ -53,6 +56,7 @@ inline val Double.weeks: Duration * ``` * @since 1.1.0 */ +@get:JvmSynthetic inline val Int.months: Duration get() = toDuration(DurationUnit.DAYS) * 30 @@ -65,6 +69,7 @@ inline val Int.months: Duration * ``` * @since 1.1.0 */ +@get:JvmSynthetic inline val Long.months: Duration get() = toDuration(DurationUnit.DAYS) * 30 @@ -81,6 +86,7 @@ inline val Long.months: Duration * @since 1.1.0 * @throws IllegalArgumentException if this [Double] value is `NaN`. */ +@get:JvmSynthetic inline val Double.months: Duration get() = toDuration(DurationUnit.DAYS) * 30 @@ -93,6 +99,7 @@ inline val Double.months: Duration * ``` * @since 1.1.0 */ +@get:JvmSynthetic inline val Int.years: Duration get() = toDuration(DurationUnit.DAYS) * 365 @@ -105,6 +112,7 @@ inline val Int.years: Duration * ``` * @since 1.1.0 */ +@get:JvmSynthetic inline val Long.years: Duration get() = toDuration(DurationUnit.DAYS) * 365 @@ -121,5 +129,6 @@ inline val Long.years: Duration * @since 1.1.0 * @throws IllegalArgumentException if this [Double] value is `NaN`. */ +@get:JvmSynthetic inline val Double.years: Duration get() = toDuration(DurationUnit.DAYS) * 365 diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/Now.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/Now.kt index fbcdd219..dcd41111 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/Now.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/Now.kt @@ -21,6 +21,7 @@ import kotlinx.datetime.TimeZone * @since 1.1.0 * @see Clock */ +@JvmSynthetic fun now(): Instant = Clock.System.now() /** @@ -69,6 +70,7 @@ fun nowInCalendar(): Calendar = nowInMilliseconds().toCalendar() * @since 1.1.0 * @see LocalDate.Companion.now */ +@JvmSynthetic fun nowInLocalDate(timeZone: TimeZone = TimeZone.currentSystemDefault()): LocalDate = LocalDate.now(timeZone) @@ -82,6 +84,7 @@ fun nowInLocalDate(timeZone: TimeZone = TimeZone.currentSystemDefault()): LocalD * @since 1.1.0 * @see LocalTime.Companion.now */ +@JvmSynthetic fun nowInLocalTime(timeZone: TimeZone = TimeZone.currentSystemDefault()): LocalTime = LocalTime.now(timeZone) @@ -95,5 +98,6 @@ fun nowInLocalTime(timeZone: TimeZone = TimeZone.currentSystemDefault()): LocalT * @since 1.1.0 * @see LocalDateTime.Companion.now */ +@JvmSynthetic fun nowInLocalDateTime(timeZone: TimeZone = TimeZone.currentSystemDefault()): LocalDateTime = LocalDateTime.now(timeZone) diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/TimeAgo.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/TimeAgo.kt index e128cff6..b1029e09 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/TimeAgo.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/TimeAgo.kt @@ -208,6 +208,7 @@ object TimeAgo { private var _default = EN val default get() = _default + @JvmField var isLocaleNumberEnabled = false private val lookupMessagesMap = mutableMapOf( EN to EnMessages, @@ -230,6 +231,7 @@ object TimeAgo { * @throws IllegalArgumentException if the [locale] is not supported. * @see LookupMessages */ + @JvmStatic fun setDefaultLocale(locale: String) { require(lookupMessagesMap.containsKey(locale)) { "[locale] must be a registered locale" } _default = locale @@ -250,6 +252,7 @@ object TimeAgo { * @throws NoSuchMessageException if the locales is not supported. * @see LookupMessages */ + @JvmStatic fun setLocaleMessages(vararg locales: String) { locales.forEach { setLocaleMessages(it) } } @@ -269,6 +272,7 @@ object TimeAgo { * @throws NoSuchMessageException if the [locale] is not supported. * @see LookupMessages */ + @JvmStatic fun setLocaleMessages(locale: String) { when (locale) { EN -> setLocaleMessages(EN, EnMessages) @@ -383,6 +387,7 @@ object TimeAgo { * * @since 1.1.0 */ + @JvmStatic fun setLocaleMessages(locale: String, lookupMessages: LookupMessages) { lookupMessagesMap[locale] = lookupMessages } @@ -401,6 +406,7 @@ object TimeAgo { * @since 1.1.0 * @throws NoSuchMessageException if the [locale] is not supported. */ + @JvmStatic fun setLocaleMessagesAndDefaultLocale(locale: String) { setLocaleMessages(locale) setDefaultLocale(locale) @@ -423,6 +429,7 @@ object TimeAgo { * @since 1.1.0 * @throws NoSuchMessageException if the [locale] is not supported. */ + @JvmStatic fun setLocaleMessagesAndDefaultLocale(locale: String, lookupMessages: LookupMessages) { setLocaleMessages(locale, lookupMessages) setDefaultLocale(locale) @@ -451,6 +458,8 @@ object TimeAgo { * ``` * @since 1.1.0 */ + @JvmStatic + @JvmOverloads fun format( date: Long, locale: String = default, @@ -580,6 +589,8 @@ object TimeAgo { * ``` * @since 1.1.0 */ + @JvmStatic + @JvmOverloads fun format( date: Date, locale: String = default, @@ -612,6 +623,8 @@ object TimeAgo { * ``` * @since 1.1.0 */ + @JvmStatic + @JvmOverloads fun format( date: Calendar, locale: String = default, @@ -651,6 +664,8 @@ object TimeAgo { * ``` * @since 1.1.0 */ + @JvmStatic + @JvmOverloads fun format( date: Instant, locale: String = default, @@ -690,6 +705,8 @@ object TimeAgo { * ``` * @since 1.1.0 */ + @JvmStatic + @JvmOverloads fun format( date: LocalDateTime, locale: String = default, @@ -828,6 +845,7 @@ object TimeAgo { * ``` * @since 1.1.0 */ +@JvmSynthetic fun Long.timeAgo( locale: String = TimeAgo.default, clock: Long = nowInMilliseconds(), @@ -858,6 +876,7 @@ fun Long.timeAgo( * ``` * @since 1.1.0 */ +@JvmSynthetic fun Date.timeAgo( locale: String = TimeAgo.default, clock: Date = nowInDate(), @@ -888,6 +907,7 @@ fun Date.timeAgo( * ``` * @since 1.1.0 */ +@JvmSynthetic fun Calendar.timeAgo( locale: String = TimeAgo.default, clock: Calendar = nowInCalendar(), @@ -918,6 +938,7 @@ fun Calendar.timeAgo( * ``` * @since 1.1.0 */ +@JvmSynthetic fun Instant.timeAgo( locale: String = TimeAgo.default, clock: Instant = now(), @@ -948,6 +969,7 @@ fun Instant.timeAgo( * ``` * @since 1.1.0 */ +@JvmSynthetic fun LocalDateTime.timeAgo( locale: String = TimeAgo.default, clock: LocalDateTime = nowInLocalDateTime(), diff --git a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/messages/NoSuchMessageException.kt b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/messages/NoSuchMessageException.kt index c5e5a709..2e68e95e 100644 --- a/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/messages/NoSuchMessageException.kt +++ b/affogato-core-ktx/src/main/java/com/parsuomash/affogato/core/ktx/time/messages/NoSuchMessageException.kt @@ -1,5 +1,3 @@ -@file:Suppress("unused") - package com.parsuomash.affogato.core.ktx.time.messages /** diff --git a/affogato-core-ktx/src/test/java/com/parsuomash/affogato/core/ktx/PrimitivesKtTest.kt b/affogato-core-ktx/src/test/java/com/parsuomash/affogato/core/ktx/PrimitivesKtTest.kt index 3d35b7c3..081025a2 100644 --- a/affogato-core-ktx/src/test/java/com/parsuomash/affogato/core/ktx/PrimitivesKtTest.kt +++ b/affogato-core-ktx/src/test/java/com/parsuomash/affogato/core/ktx/PrimitivesKtTest.kt @@ -48,4 +48,19 @@ internal class PrimitivesKtTest { assertThat(1.0.isNegative).isFalse() assertThat((-1.0).isNegative).isTrue() } + + @Test + fun `checking positivity`() { + assertThat(1.isPositive).isTrue() + assertThat((-1).isPositive).isFalse() + + assertThat(1L.isPositive).isTrue() + assertThat((-1L).isNegative).isFalse() + + assertThat(1F.isPositive).isTrue() + assertThat((-1F).isPositive).isFalse() + + assertThat(1.0.isPositive).isTrue() + assertThat((-1.0).isPositive).isFalse() + } } diff --git a/affogato-coroutines-android/build.gradle.kts b/affogato-coroutines-android/build.gradle.kts index 5f30d086..003a2f8a 100644 --- a/affogato-coroutines-android/build.gradle.kts +++ b/affogato-coroutines-android/build.gradle.kts @@ -7,6 +7,11 @@ plugins { android { compileSdk = 33 buildToolsVersion = "33.0.0" + defaultConfig { + minSdk = 16 + targetSdk = 33 + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 @@ -33,7 +38,7 @@ afterEvaluate { create("release") { groupId = "com.parsuomash.affogato" artifactId = "affogato-coroutines-android" - version = "1.5.0" + version = "1.5.1" from(components["release"]) } diff --git a/affogato-coroutines-core/build.gradle.kts b/affogato-coroutines-core/build.gradle.kts index cc381a44..95531063 100644 --- a/affogato-coroutines-core/build.gradle.kts +++ b/affogato-coroutines-core/build.gradle.kts @@ -39,10 +39,10 @@ dependencies { afterEvaluate { publishing { publications { - create("java") { + create("release") { groupId = "com.parsuomash.affogato" artifactId = "affogato-coroutines-core" - version = "1.5.0" + version = "1.5.1" from(components["java"]) } diff --git a/affogato-coroutines-core/src/main/java/com/parsuomash/affogato/coroutines/core/Standard.kt b/affogato-coroutines-core/src/main/java/com/parsuomash/affogato/coroutines/core/Standard.kt index 82d003fc..d9ec6e09 100644 --- a/affogato-coroutines-core/src/main/java/com/parsuomash/affogato/coroutines/core/Standard.kt +++ b/affogato-coroutines-core/src/main/java/com/parsuomash/affogato/coroutines/core/Standard.kt @@ -1,5 +1,3 @@ -@file:Suppress("unused") - package com.parsuomash.affogato.coroutines.core import com.parsuomash.affogato.core.ktx.tryCatchBool @@ -24,6 +22,7 @@ import kotlinx.coroutines.withContext * @since 1.2.0 * @see tryCatchIgnore */ +@JvmSynthetic suspend inline fun suspendedTryCatchIgnore( context: CoroutineContext = Dispatchers.Default, crossinline block: suspend () -> T @@ -45,6 +44,7 @@ suspend inline fun suspendedTryCatchIgnore( * @see tryCatchBoolean * @see suspendedTryCatchBool */ +@JvmSynthetic suspend inline fun suspendedTryCatchBoolean( context: CoroutineContext = Dispatchers.Default, crossinline block: suspend () -> Unit @@ -64,6 +64,7 @@ suspend inline fun suspendedTryCatchBoolean( * @see tryCatchBool * @see suspendedTryCatchBoolean */ +@JvmSynthetic suspend inline fun suspendedTryCatchBool( context: CoroutineContext = Dispatchers.Default, crossinline block: suspend () -> Boolean @@ -82,6 +83,7 @@ suspend inline fun suspendedTryCatchBool( * @since 1.2.0 * @see tryCatchNull */ +@JvmSynthetic suspend inline fun suspendedTryCatchNull( context: CoroutineContext = Dispatchers.Default, crossinline block: suspend () -> T @@ -100,6 +102,7 @@ suspend inline fun suspendedTryCatchNull( * @since 1.2.0 * @see tryCatchElse */ +@JvmSynthetic suspend inline fun suspendedTryCatchElse( context: CoroutineContext = Dispatchers.Default, crossinline elseBlock: suspend () -> T, diff --git a/affogato-logger-android/build.gradle.kts b/affogato-logger-android/build.gradle.kts index 3cf76500..fb23e4e4 100644 --- a/affogato-logger-android/build.gradle.kts +++ b/affogato-logger-android/build.gradle.kts @@ -7,6 +7,11 @@ plugins { android { compileSdk = 33 buildToolsVersion = "33.0.0" + defaultConfig { + minSdk = 16 + targetSdk = 33 + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 @@ -24,7 +29,7 @@ afterEvaluate { create("release") { groupId = "com.parsuomash.affogato" artifactId = "affogato-logger-android" - version = "1.5.0" + version = "1.5.1" from(components["release"]) } diff --git a/affogato-logger-android/src/main/java/com/parsuomash/affogato/logger/android/Ktx.kt b/affogato-logger-android/src/main/java/com/parsuomash/affogato/logger/android/Extension.kt similarity index 92% rename from affogato-logger-android/src/main/java/com/parsuomash/affogato/logger/android/Ktx.kt rename to affogato-logger-android/src/main/java/com/parsuomash/affogato/logger/android/Extension.kt index f3e4c462..97ae6ee4 100644 --- a/affogato-logger-android/src/main/java/com/parsuomash/affogato/logger/android/Ktx.kt +++ b/affogato-logger-android/src/main/java/com/parsuomash/affogato/logger/android/Extension.kt @@ -5,8 +5,8 @@ package com.parsuomash.affogato.logger.android * * Example : * ```kotlin - * logcat { "Hello, Napier" } - * logcat(tag = "your tag") { "Hello, Napier" } + * logcat { "Hello, Affogato" } + * logcat(tag = "your tag") { "Hello, Affogato" } * ``` * @since 1.5.0 * @param priority enum: The priority/type of this log message Value is ASSERT, @@ -17,6 +17,7 @@ package com.parsuomash.affogato.logger.android * @param message Lambda: The message you would like logged. This value cannot be null. * @see Logger */ +@JvmSynthetic inline fun logcat( priority: LogLevel = LogLevel.DEBUG, throwable: Throwable? = null, diff --git a/affogato-logger-android/src/main/java/com/parsuomash/affogato/logger/android/Logger.kt b/affogato-logger-android/src/main/java/com/parsuomash/affogato/logger/android/Logger.kt index d201d798..83ffa1d7 100644 --- a/affogato-logger-android/src/main/java/com/parsuomash/affogato/logger/android/Logger.kt +++ b/affogato-logger-android/src/main/java/com/parsuomash/affogato/logger/android/Logger.kt @@ -1,5 +1,3 @@ -@file:Suppress("MemberVisibilityCanBePrivate") - package com.parsuomash.affogato.logger.android import android.util.Log @@ -19,7 +17,7 @@ import android.util.Log * YandexMetrica.reportError(message, throwable) * } * } - * Logger.info(message = "Hello world!") + * Logger.info(message = "Hello Affogato!") * ``` * @since 1.5.0 * @see logcat @@ -29,18 +27,21 @@ object Logger { * Logging tag help for beter filter and search. * @since 1.5.0 */ + @JvmField var tag: String = "Logger" /** * When is true printing logs, otherwise run onRelease block. * @since 1.5.0 */ + @JvmField var isDebug: Boolean = true /** * With onRelease block we define our api for logging in release mode like use crash service. * @since 1.5.0 */ + @JvmField var onRelease: ((tag: String?, message: String, throwable: Throwable) -> Unit)? = null /** @@ -51,6 +52,7 @@ object Logger { * @param tag String: Used to identify the source of a log message. It usually * identifies the class or activity where the log call occurs. This value may be null. */ + @JvmStatic fun verbose(tag: String?, message: String, throwable: Throwable?) { if (isDebug) { if (throwable != null) { @@ -71,6 +73,7 @@ object Logger { * @param tag String: Used to identify the source of a log message. It usually * identifies the class or activity where the log call occurs. This value may be null. */ + @JvmStatic fun debug(tag: String?, message: String, throwable: Throwable?) { if (isDebug) { if (throwable != null) { @@ -91,6 +94,7 @@ object Logger { * @param tag String: Used to identify the source of a log message. It usually * identifies the class or activity where the log call occurs. This value may be null. */ + @JvmStatic fun info(tag: String?, message: String, throwable: Throwable?) { if (isDebug) { if (throwable != null) { @@ -111,6 +115,7 @@ object Logger { * @param tag String: Used to identify the source of a log message. It usually * identifies the class or activity where the log call occurs. This value may be null. */ + @JvmStatic fun warn(tag: String?, message: String, throwable: Throwable?) { if (isDebug) { if (throwable != null) { @@ -131,6 +136,7 @@ object Logger { * @param tag String: Used to identify the source of a log message. It usually * identifies the class or activity where the log call occurs. This value may be null. */ + @JvmStatic fun error(tag: String?, message: String, throwable: Throwable?) { if (isDebug) { if (throwable != null) { @@ -151,6 +157,8 @@ object Logger { * @param tag String: Used to identify the source of a log message. It usually * identifies the class or activity where the log call occurs. This value may be null. */ + @JvmStatic + @JvmName("wtf") fun assert(tag: String?, message: String, throwable: Throwable?) { if (isDebug) { if (throwable != null) { diff --git a/affogato-metrica-ktx/build.gradle.kts b/affogato-metrica-ktx/build.gradle.kts index 672c026c..2413b52b 100644 --- a/affogato-metrica-ktx/build.gradle.kts +++ b/affogato-metrica-ktx/build.gradle.kts @@ -7,6 +7,11 @@ plugins { android { compileSdk = 33 buildToolsVersion = "33.0.0" + defaultConfig { + minSdk = 17 + targetSdk = 33 + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 @@ -34,7 +39,7 @@ afterEvaluate { create("release") { groupId = "com.parsuomash.affogato" artifactId = "affogato-metrica-ktx" - version = "1.5.0" + version = "1.5.1" from(components["release"]) } diff --git a/affogato-metrica-ktx/src/main/java/com/parsuomash/affogato/metrica/ktx/MetricaBuilder.kt b/affogato-metrica-ktx/src/main/java/com/parsuomash/affogato/metrica/ktx/MetricaBuilder.kt index c4036762..ebea248b 100644 --- a/affogato-metrica-ktx/src/main/java/com/parsuomash/affogato/metrica/ktx/MetricaBuilder.kt +++ b/affogato-metrica-ktx/src/main/java/com/parsuomash/affogato/metrica/ktx/MetricaBuilder.kt @@ -1,5 +1,3 @@ -@file:Suppress("unused") - package com.parsuomash.affogato.metrica.ktx import android.content.Context @@ -64,6 +62,7 @@ inline fun Context.yandexMetrica( * @return the same YandexMetricaConfig.Builder object. * @see YandexMetricaConfig.Builder.withLogs */ +@JvmSynthetic fun YandexMetricaConfig.Builder.withLogs(isDebugMode: Boolean = true): YandexMetricaConfig.Builder = if (isDebugMode) withLogs() else this @@ -79,6 +78,7 @@ fun YandexMetricaConfig.Builder.withLogs(isDebugMode: Boolean = true): YandexMet * @return the same YandexMetricaConfig.Builder object. * @see YandexMetricaConfig.Builder.withSessionTimeout */ +@JvmSynthetic fun YandexMetricaConfig.Builder.withSessionTimeout( duration: Duration ): YandexMetricaConfig.Builder = withSessionTimeout(duration.inWholeSeconds.toInt()) diff --git a/affogato-metrica-ktx/src/main/java/com/parsuomash/affogato/metrica/ktx/YandexMetricaX.kt b/affogato-metrica-ktx/src/main/java/com/parsuomash/affogato/metrica/ktx/YandexMetricaX.kt index 6a3a50d3..514bcd28 100644 --- a/affogato-metrica-ktx/src/main/java/com/parsuomash/affogato/metrica/ktx/YandexMetricaX.kt +++ b/affogato-metrica-ktx/src/main/java/com/parsuomash/affogato/metrica/ktx/YandexMetricaX.kt @@ -1,5 +1,3 @@ -@file:Suppress("unused") - package com.parsuomash.affogato.metrica.ktx import com.yandex.metrica.YandexMetrica diff --git a/affogato-metrica-ktx/src/main/java/com/parsuomash/affogato/metrica/ktx/profile/UserProfile.kt b/affogato-metrica-ktx/src/main/java/com/parsuomash/affogato/metrica/ktx/profile/UserProfile.kt index d665f6d8..6f357717 100644 --- a/affogato-metrica-ktx/src/main/java/com/parsuomash/affogato/metrica/ktx/profile/UserProfile.kt +++ b/affogato-metrica-ktx/src/main/java/com/parsuomash/affogato/metrica/ktx/profile/UserProfile.kt @@ -1,5 +1,3 @@ -@file:Suppress("unused") - package com.parsuomash.affogato.metrica.ktx.profile import com.yandex.metrica.YandexMetrica @@ -35,6 +33,7 @@ import com.yandex.metrica.profile.UserProfileUpdate * @see UserProfile.Builder * @see UserProfile */ +@JvmSynthetic inline fun metricaProfile(init: UserProfile.Builder.() -> Unit): UserProfile { val builder: UserProfile.Builder = UserProfile.newBuilder().also { init(it) } return builder.build() @@ -47,6 +46,7 @@ inline fun metricaProfile(init: UserProfile.Builder.() -> Unit): UserProfile { * @return The UserProfileUpdate object. * @see NumberAttribute.withValue */ +@JvmSynthetic fun NumberAttribute.withValue(value: Int): UserProfileUpdate = withValue(value.toDouble()) @@ -57,5 +57,6 @@ fun NumberAttribute.withValue(value: Int): UserProfileUpdate = * @return The UserProfileUpdate object. * @see CounterAttribute.withDelta */ +@JvmSynthetic fun CounterAttribute.withDelta(value: Int): UserProfileUpdate = withDelta(value.toDouble()) diff --git a/affogato-okhttp-android/build.gradle.kts b/affogato-okhttp-android/build.gradle.kts index cc422bfb..8fcd3fa9 100644 --- a/affogato-okhttp-android/build.gradle.kts +++ b/affogato-okhttp-android/build.gradle.kts @@ -7,6 +7,11 @@ plugins { android { compileSdk = 33 buildToolsVersion = "33.0.0" + defaultConfig { + minSdk = 16 + targetSdk = 33 + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 @@ -34,7 +39,7 @@ afterEvaluate { create("release") { groupId = "com.parsuomash.affogato" artifactId = "affogato-okhttp-android" - version = "1.5.0" + version = "1.5.1" from(components["release"]) } diff --git a/affogato-okhttp-android/src/main/java/com/parsuomash/affogato/okhttp/android/OkHttp.kt b/affogato-okhttp-android/src/main/java/com/parsuomash/affogato/okhttp/android/OkHttp.kt index 34090858..d3183cf3 100644 --- a/affogato-okhttp-android/src/main/java/com/parsuomash/affogato/okhttp/android/OkHttp.kt +++ b/affogato-okhttp-android/src/main/java/com/parsuomash/affogato/okhttp/android/OkHttp.kt @@ -81,6 +81,7 @@ import okhttp3.Response * @since 1.5.0 * @see OkHttpClient */ +@JvmSynthetic inline fun okHttp( init: OkHttpClient.Builder.() -> Unit ): OkHttpClient { @@ -92,6 +93,7 @@ inline fun okHttp( * @since 1.5.0 * @see OkHttpClient */ +@JvmSynthetic inline fun OkHttpClient.new( init: OkHttpClient.Builder.() -> Unit ): OkHttpClient { @@ -103,6 +105,7 @@ inline fun OkHttpClient.new( * @since 1.5.0 * @see Response */ +@JvmSynthetic inline fun Response.new( init: Response.Builder.() -> Unit ): Response { diff --git a/affogato-structure/build.gradle.kts b/affogato-structure/build.gradle.kts index c7621dbd..d52c8da4 100644 --- a/affogato-structure/build.gradle.kts +++ b/affogato-structure/build.gradle.kts @@ -41,10 +41,10 @@ dependencies { afterEvaluate { publishing { publications { - create("java") { + create("release") { groupId = "com.parsuomash.affogato" artifactId = "affogato-structure" - version = "1.5.0" + version = "1.5.1" from(components["java"]) } diff --git a/affogato-structure/src/main/java/com/parsuomash/affogato/structure/lazy_object/SingletonHolder.kt b/affogato-structure/src/main/java/com/parsuomash/affogato/structure/lazy_object/SingletonHolder.kt index c9718b91..f3ea0d5f 100644 --- a/affogato-structure/src/main/java/com/parsuomash/affogato/structure/lazy_object/SingletonHolder.kt +++ b/affogato-structure/src/main/java/com/parsuomash/affogato/structure/lazy_object/SingletonHolder.kt @@ -1,5 +1,3 @@ -@file:Suppress("unused") - package com.parsuomash.affogato.structure.lazy_object import com.parsuomash.affogato.core.ktx.runBlock diff --git a/affogato-structure/src/main/java/com/parsuomash/affogato/structure/validation/Password.kt b/affogato-structure/src/main/java/com/parsuomash/affogato/structure/validation/Password.kt index ceafb84a..77e4d28a 100644 --- a/affogato-structure/src/main/java/com/parsuomash/affogato/structure/validation/Password.kt +++ b/affogato-structure/src/main/java/com/parsuomash/affogato/structure/validation/Password.kt @@ -74,6 +74,7 @@ open class Password { initialize() } + @JvmOverloads fun isValidLength(length: Int = 8, initialize: (Boolean) -> Unit) { passwordLength = length lengthHolder = initialize @@ -130,5 +131,6 @@ open class Password { * ``` * @since 1.4.0 */ +@JvmSynthetic fun password(init: Password.Builder.() -> Unit): Password = Password.Builder(init).build() diff --git a/affogato-structure/src/main/java/com/parsuomash/affogato/structure/validation/Phone.kt b/affogato-structure/src/main/java/com/parsuomash/affogato/structure/validation/Phone.kt index 7d3e1004..0ee41960 100644 --- a/affogato-structure/src/main/java/com/parsuomash/affogato/structure/validation/Phone.kt +++ b/affogato-structure/src/main/java/com/parsuomash/affogato/structure/validation/Phone.kt @@ -29,6 +29,7 @@ value class Phone(val value: String) : Emptiness { * or null can be supplied. * @return a boolean that indicates whether the number is of a valid pattern. */ + @JvmOverloads fun isValid(defaultRegion: String? = null): Boolean { return tryCatchBoolean { val number = phoneNumberKit.parse(value, defaultRegion) @@ -46,6 +47,7 @@ value class Phone(val value: String) : Emptiness { * or null can be supplied. * @return the type of the phone number, or UNKNOWN if it is invalid. */ + @JvmOverloads fun type(defaultRegion: String? = null): PhoneNumberType? { return tryCatchNull { val number = phoneNumberKit.parse(value, defaultRegion) @@ -65,6 +67,7 @@ value class Phone(val value: String) : Emptiness { * [INTERNATIONAL] * @return the formatted phone number. */ + @JvmOverloads fun format( defaultRegion: String? = null, numberFormat: PhoneNumberFormat = INTERNATIONAL @@ -107,4 +110,5 @@ typealias PhoneNumberFormat = PhoneNumberUtil.PhoneNumberFormat */ typealias PhoneNumberType = PhoneNumberUtil.PhoneNumberType +@get:JvmSynthetic private val phoneNumberKit: PhoneNumberUtil by lazy { PhoneNumberUtil.getInstance() } diff --git a/affogato-unit-processor/build.gradle.kts b/affogato-unit-processor/build.gradle.kts index 58e02736..4df41da3 100644 --- a/affogato-unit-processor/build.gradle.kts +++ b/affogato-unit-processor/build.gradle.kts @@ -32,10 +32,10 @@ dependencies { afterEvaluate { publishing { publications { - create("java") { + create("release") { groupId = "com.parsuomash.affogato" artifactId = "affogato-unit-processor" - version = "1.5.0" + version = "1.5.1" from(components["java"]) } diff --git a/affogato-unit/build.gradle.kts b/affogato-unit/build.gradle.kts index 0f7424a1..ccda6c94 100644 --- a/affogato-unit/build.gradle.kts +++ b/affogato-unit/build.gradle.kts @@ -10,6 +10,8 @@ android { defaultConfig { minSdk = 21 + targetSdk = 33 + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 @@ -57,7 +59,7 @@ afterEvaluate { create("release") { groupId = "com.parsuomash.affogato" artifactId = "affogato-unit" - version = "1.5.0" + version = "1.5.1" from(components["release"]) } diff --git a/affogato-unit/src/main/java/com/parsuomash/affogato/unit/Dimen.kt b/affogato-unit/src/main/java/com/parsuomash/affogato/unit/Dimen.kt index a938d6d1..795f24a7 100644 --- a/affogato-unit/src/main/java/com/parsuomash/affogato/unit/Dimen.kt +++ b/affogato-unit/src/main/java/com/parsuomash/affogato/unit/Dimen.kt @@ -1,5 +1,3 @@ -@file:Suppress("unused") - package com.parsuomash.affogato.unit /** diff --git a/affogato-unit/src/main/java/com/parsuomash/affogato/unit/sdp.kt b/affogato-unit/src/main/java/com/parsuomash/affogato/unit/sdp.kt index f5204983..e6c0dddd 100644 --- a/affogato-unit/src/main/java/com/parsuomash/affogato/unit/sdp.kt +++ b/affogato-unit/src/main/java/com/parsuomash/affogato/unit/sdp.kt @@ -1,5 +1,6 @@ package com.parsuomash.affogato.unit +import android.annotation.SuppressLint import androidx.compose.runtime.Composable import androidx.compose.runtime.Stable import androidx.compose.ui.platform.LocalContext @@ -17,9 +18,9 @@ import androidx.compose.ui.unit.dp * @since 1.0.0 */ @Stable +@get:JvmSynthetic val Int.sdp: Dp - @Composable - get() = getSdp() + @Composable get() = getSdp() @JvmName("_getSdp") @Composable @@ -34,11 +35,16 @@ private fun Int.getSdp(): Dp { return if (resourceField != 0) dimensionResource(resourceField) else this.dp } +@SuppressLint("DiscouragedApi") +@JvmSynthetic @Composable internal fun getFieldId(id: String): Int { val context = LocalContext.current return context.resources.getIdentifier(id, "dimen", context.packageName) } +@get:JvmSynthetic internal const val MAX_DP = 600 + +@get:JvmSynthetic internal const val MAX_NEGATIVE_DP = 60 diff --git a/affogato-unit/src/main/java/com/parsuomash/affogato/unit/ssp.kt b/affogato-unit/src/main/java/com/parsuomash/affogato/unit/ssp.kt index 94995691..16649f65 100644 --- a/affogato-unit/src/main/java/com/parsuomash/affogato/unit/ssp.kt +++ b/affogato-unit/src/main/java/com/parsuomash/affogato/unit/ssp.kt @@ -17,9 +17,9 @@ import androidx.compose.ui.unit.sp * @since 1.0.0 */ @Stable +@get:JvmSynthetic val Int.ssp: TextUnit - @Composable - get() = getSsp() + @Composable get() = getSsp() @JvmName("_getSsp") @Composable diff --git a/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/FoldingFeature.kt b/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/FoldingFeature.kt index 7161846e..3f9e0326 100644 --- a/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/FoldingFeature.kt +++ b/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/FoldingFeature.kt @@ -1,5 +1,3 @@ -@file:Suppress("unused") - package com.parsuomash.affogato.unit.window import android.content.res.Configuration @@ -17,22 +15,25 @@ import androidx.window.layout.FoldingFeature * Returns a height dp size of the hinge from a [FoldingFeature]. * @since 1.0.0 */ +@get:JvmSynthetic inline val FoldingFeature.hingeWidthDp: Dp - @JvmSynthetic get() = hingeWidthDpSize.dp + get() = hingeWidthDpSize.dp /** * Returns a height dp size of the hinge from a [FoldingFeature]. * @since 1.0.0 */ +@get:JvmSynthetic inline val FoldingFeature.hingeHeightDp: Dp - @JvmSynthetic get() = hingeHeightDpSize.dp + get() = hingeHeightDpSize.dp /** * Returns a dp size of the hinge according to the window orientation from a [FoldingFeature]. * @since 1.0.0 */ +@get:JvmSynthetic inline val FoldingFeature.hingeDp: Dp - @Composable @JvmSynthetic get() = when (windowOrientation) { + @Composable get() = when (windowOrientation) { WindowOrientation.ORIENTATION_LANDSCAPE -> hingeWidthDp WindowOrientation.ORIENTATION_PORTRAIT -> hingeHeightDp } @@ -41,29 +42,33 @@ inline val FoldingFeature.hingeDp: Dp * Returns a dp size of the hinge from a [FoldingFeature]. * @since 1.0.0 */ +@get:JvmSynthetic inline val FoldingFeature.hingeDpSize: DpSize - @JvmSynthetic get() = DpSize(width = hingeWidthDpSize.dp, height = hingeWidthDpSize.dp) + get() = DpSize(width = hingeWidthDpSize.dp, height = hingeWidthDpSize.dp) /** * Returns a width pixel size of the hinge from a [FoldingFeature]. * @since 1.0.0 */ +@get:JvmSynthetic inline val FoldingFeature.hingeWidthPxSize: Float - @JvmSynthetic get() = toSize().width + get() = toSize().width /** * Returns a width pixel size of the hinge from a [FoldingFeature]. * @since 1.0.0 */ +@get:JvmSynthetic inline val FoldingFeature.hingeHeightPxSize: Float - @JvmSynthetic get() = toSize().height + get() = toSize().height /** * Returns a pixel size of the hinge from a [FoldingFeature]. * @since 1.0.0 */ +@get:JvmSynthetic inline val FoldingFeature.hingePxSize: Float - @JvmSynthetic get() = + get() = if (Resources.getSystem().configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) { hingeWidthPxSize } else { @@ -74,22 +79,25 @@ inline val FoldingFeature.hingePxSize: Float * Returns a width Dp size of the hinge from a [FoldingFeature]. * @since 1.0.0 */ +@get:JvmSynthetic inline val FoldingFeature.hingeWidthDpSize: Float - @JvmSynthetic get() = toSize().width + get() = toSize().width /** * Returns a width Dp size of the hinge from a [FoldingFeature]. * @since 1.0.0 */ +@get:JvmSynthetic inline val FoldingFeature.hingeHeightDpSize: Float - @JvmSynthetic get() = toSize().height + get() = toSize().height /** * Returns whether a [FoldingFeature] is the table-top mode. * @since 1.0.0 */ +@get:JvmSynthetic inline val FoldingFeature.isTableTopPosture: Boolean - @JvmSynthetic get() { + get() { return state == FoldingFeature.State.HALF_OPENED && orientation == FoldingFeature.Orientation.HORIZONTAL } @@ -98,8 +106,9 @@ inline val FoldingFeature.isTableTopPosture: Boolean * Returns whether a [FoldingFeature] is the book mode. * @since 1.0.0 */ +@get:JvmSynthetic inline val FoldingFeature.isBookPosture: Boolean - @JvmSynthetic get() { + get() { return state == FoldingFeature.State.HALF_OPENED && orientation == FoldingFeature.Orientation.VERTICAL } @@ -108,34 +117,39 @@ inline val FoldingFeature.isBookPosture: Boolean * Returns whether the state of a [FoldingFeature] is half-opened. * @since 1.0.0 */ +@get:JvmSynthetic inline val FoldingFeature.isHalfOpened: Boolean - @JvmSynthetic get() = state == FoldingFeature.State.HALF_OPENED + get() = state == FoldingFeature.State.HALF_OPENED /** * Returns whether the state of a [FoldingFeature] is flat. * @since 1.0.0 */ +@get:JvmSynthetic inline val FoldingFeature.isFlat: Boolean - @JvmSynthetic get() = state == FoldingFeature.State.FLAT + get() = state == FoldingFeature.State.FLAT /** * Returns whether the orientation of a [FoldingFeature] is vertical. * @since 1.0.0 */ +@get:JvmSynthetic inline val FoldingFeature.isVertical: Boolean - @JvmSynthetic get() = orientation == FoldingFeature.Orientation.HORIZONTAL + get() = orientation == FoldingFeature.Orientation.HORIZONTAL /** * Returns whether the orientation of a [FoldingFeature] is horizontal. * @since 1.0.0 */ +@get:JvmSynthetic inline val FoldingFeature.isHorizontal: Boolean - @JvmSynthetic get() = orientation == FoldingFeature.Orientation.HORIZONTAL + get() = orientation == FoldingFeature.Orientation.HORIZONTAL /** * Finds a [FoldingFeature] from a list of [DisplayFeature]. * @since 1.0.0 */ +@JvmSynthetic fun List.findFoldingFeature(): FoldingFeature? = filterIsInstance().firstOrNull() @@ -143,6 +157,7 @@ fun List.findFoldingFeature(): FoldingFeature? = * Returns a [Posture] which represent the current posture of the foldable device. * @since 1.0.0 */ +@JvmSynthetic fun FoldingFeature.toPosture(): Posture = when { isTableTopPosture -> Posture.TableTop(bounds.toSize()) isBookPosture -> Posture.Book(bounds.toSize()) @@ -153,6 +168,7 @@ fun FoldingFeature.toPosture(): Posture = when { * Returns a [Size] spec from a [FoldingFeature]. * @since 1.0.0 */ +@JvmSynthetic fun DisplayFeature.toSize(): Size = Size((bounds.right - bounds.left).toFloat(), (bounds.bottom - bounds.top).toFloat()) @@ -160,5 +176,4 @@ fun DisplayFeature.toSize(): Size = * Returns [Size] class from a [Rect] class. * @since 1.0.0 */ -@JvmSynthetic private fun Rect.toSize(): Size = Size((right - left).toFloat(), (bottom - top).toFloat()) diff --git a/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/Posture.kt b/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/Posture.kt index 6cba567a..f2d4149b 100644 --- a/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/Posture.kt +++ b/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/Posture.kt @@ -46,20 +46,24 @@ sealed class Posture(val size: Size) { * @since 1.0.0 */ @ExperimentalLifecycleComposeApi +@get:JvmSynthetic inline val Activity.postureState: State - @Composable get() = postureFlow.collectAsStateWithLifecycle(initialValue = Posture.Normal) + @Composable get() = postureFlow + .collectAsStateWithLifecycle(initialValue = Posture.Normal) /** * Returns a [Flow] of the [Posture] by tracking the [WindowLayoutInfo]. * @since 1.0.0 */ +@get:JvmSynthetic inline val Activity.postureFlow: Flow - @JvmSynthetic get() = WindowInfoTracker.getOrCreate(this).postureFlow(this) + get() = WindowInfoTracker.getOrCreate(this).postureFlow(this) /** * Returns a [Flow] of the [Posture] by tracking the [WindowLayoutInfo]. * @since 1.0.0 */ +@JvmSynthetic fun WindowInfoTracker.postureFlow(activity: Activity): Flow { return activity.windowLayoutInfo.map { layoutInfo -> layoutInfo.findFoldingFeature()?.toPosture() diff --git a/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/WindowLayoutInfo.kt b/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/WindowLayoutInfo.kt index d8c9bc9f..fb74f1d9 100644 --- a/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/WindowLayoutInfo.kt +++ b/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/WindowLayoutInfo.kt @@ -1,5 +1,3 @@ -@file:Suppress("unused") - package com.parsuomash.affogato.unit.window import android.app.Activity @@ -16,17 +14,19 @@ import kotlinx.coroutines.flow.Flow * Returns a [State] of the [WindowLayoutInfo]. * @since 1.0.0 */ +@get:JvmSynthetic @ExperimentalLifecycleComposeApi inline val Activity.windowLayoutInfoState: State - @JvmSynthetic @Composable get() = + @Composable get() = windowLayoutInfo.collectAsStateWithLifecycle(initialValue = null) /** * Returns a [Flow] of the [WindowLayoutInfo]. * @since 1.0.0 */ +@get:JvmSynthetic inline val Activity.windowLayoutInfo: Flow - @JvmSynthetic get() = WindowInfoTracker.getOrCreate(this).windowLayoutInfo(this) + get() = WindowInfoTracker.getOrCreate(this).windowLayoutInfo(this) /** * Calculates if a [FoldingFeature] should be thought of as splitting the window into @@ -35,8 +35,9 @@ inline val Activity.windowLayoutInfo: Flow * separating when they are not [FoldingFeature.State.FLAT]. * @since 1.0.0 */ +@get:JvmSynthetic inline val WindowLayoutInfo.isSeparating: Boolean - @JvmSynthetic get() = findFoldingFeature()?.isSeparating ?: false + get() = findFoldingFeature()?.isSeparating ?: false /** * Calculates the occlusion mode to determine if a FoldingFeature occludes a part of the window. @@ -44,8 +45,9 @@ inline val WindowLayoutInfo.isSeparating: Boolean * For some devices occluded elements can not be accessed by the user at all. * @since 1.0.0 */ +@get:JvmSynthetic inline val WindowLayoutInfo.occlusionType: FoldingFeature.OcclusionType - @JvmSynthetic get() = findFoldingFeature()?.occlusionType + get() = findFoldingFeature()?.occlusionType ?: FoldingFeature.OcclusionType.NONE /** @@ -53,16 +55,18 @@ inline val WindowLayoutInfo.occlusionType: FoldingFeature.OcclusionType * [FoldingFeature.Orientation.VERTICAL] otherwise. * @since 1.0.0 */ +@get:JvmSynthetic inline val WindowLayoutInfo.orientation: FoldingFeature.Orientation - @JvmSynthetic get() = findFoldingFeature()?.orientation + get() = findFoldingFeature()?.orientation ?: FoldingFeature.Orientation.HORIZONTAL /** * Returns the [FoldingFeature.State] for the [FoldingFeature]. * @since 1.0.0 */ +@get:JvmSynthetic inline val WindowLayoutInfo.state: FoldingFeature.State - @JvmSynthetic get() = findFoldingFeature()?.state + get() = findFoldingFeature()?.state ?: FoldingFeature.State.FLAT /** @@ -70,6 +74,7 @@ inline val WindowLayoutInfo.state: FoldingFeature.State * @since 1.0.0 */ @ExperimentalLifecycleComposeApi +@JvmSynthetic @Composable fun WindowInfoTracker.windowLayoutInfoState(activity: Activity): State = windowLayoutInfo(activity).collectAsStateWithLifecycle(initialValue = null) @@ -78,5 +83,6 @@ fun WindowInfoTracker.windowLayoutInfoState(activity: Activity): State().firstOrNull() diff --git a/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/WindowOrientation.kt b/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/WindowOrientation.kt index a6ea51cf..dd6ac3c7 100644 --- a/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/WindowOrientation.kt +++ b/affogato-unit/src/main/java/com/parsuomash/affogato/unit/window/WindowOrientation.kt @@ -29,6 +29,7 @@ enum class WindowOrientation { * @since 1.0.0 * @see android.content.res.Configuration */ +@get:JvmSynthetic inline val windowOrientation: WindowOrientation @Composable get() = if (LocalConfiguration.current.orientation == Configuration.ORIENTATION_LANDSCAPE) { @@ -42,5 +43,6 @@ inline val windowOrientation: WindowOrientation * @since 1.0.0 * @see android.content.res.Configuration */ +@get:JvmSynthetic inline val Configuration.isLandscape: Boolean @Composable get() = windowOrientation == WindowOrientation.ORIENTATION_LANDSCAPE diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/as-decimal.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/as-decimal.html new file mode 100644 index 00000000..84e3c1d2 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/as-decimal.html @@ -0,0 +1,54 @@ + + + + + asDecimal + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

asDecimal

+
+
public final String asDecimal()
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/as-hex.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/as-hex.html new file mode 100644 index 00000000..32f1c703 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/as-hex.html @@ -0,0 +1,54 @@ + + + + + asHex + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

asHex

+
+
public final String asHex()
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/as-reversed-decimal.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/as-reversed-decimal.html new file mode 100644 index 00000000..ecb7cca8 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/as-reversed-decimal.html @@ -0,0 +1,54 @@ + + + + + asReversedDecimal + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

asReversedDecimal

+
+
public final String asReversedDecimal()
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/as-reversed-hex.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/as-reversed-hex.html new file mode 100644 index 00000000..2ca88dd4 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/as-reversed-hex.html @@ -0,0 +1,54 @@ + + + + + asReversedHex + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

asReversedHex

+
+
public final String asReversedHex()
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/get-or-else.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/get-or-else.html index 5aaac25f..15a58229 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/get-or-else.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/get-or-else.html @@ -42,7 +42,7 @@

getOrElse

-
public final static Array<T> getOrElse<T extends Any>(    Array<T> $self,     IntRange indices,     Function0<Array<T>> defaultValue)

Returns the sub-array from the given range if exist otherwise return else block.

Example:

arrayOf(1..10).getOrElse(0..4) { arrayOf(1) } // [1, 2, 3, 4, 5]
arrayOf(1..10).getOrElse(10..14) { arrayOf(1) } // [1]

Since

1.1.0

See also


public final static ByteArray getOrElse(    ByteArray $self,     IntRange indices,     Function0<ByteArray> defaultValue)

Returns the sub-array from the given range if exist otherwise return else block.

Example:

byteArrayOf(1, 2, 3, 4, 5, 6, 7, 9, 10).getOrElse(0..4) { byteArrayOf(1) } // [1, 2, 3, 4, 5]
byteArrayOf(1, 2, 3, 4, 5, 6, 7, 9, 10).getOrElse(10..14) { byteArrayOf(1) } // [1]

Since

1.1.0

See also


public final static CharArray getOrElse(    CharArray $self,     IntRange indices,     Function0<CharArray> defaultValue)

Returns the sub-array from the given range if exist otherwise return else block.

Example:

charArrayOf('a'..'z').getOrElse(0..4) { charArrayOf('a') } // ['a', 'b', 'c', 'd', 'e']
charArrayOf('a'..'z').getOrElse(10..14) { charArrayOf('a') } // ['a']

Since

1.1.0

See also


public final static ShortArray getOrElse(    ShortArray $self,     IntRange indices,     Function0<ShortArray> defaultValue)

Returns the sub-array from the given range if exist otherwise return else block.

Example:

shortArrayOf(1, 2, 3, 4, 5, 6, 7, 9, 10).getOrElse(0..4) { shortArrayOf(1) } // [1, 2, 3, 4, 5]
shortArrayOf(1, 2, 3, 4, 5, 6, 7, 9, 10).getOrElse(10..14) { shortArrayOf(1) } // [1]

Since

1.1.0

See also


public final static IntArray getOrElse(    IntArray $self,     IntRange indices,     Function0<IntArray> defaultValue)

Returns the sub-array from the given range if exist otherwise return else block.

Example:

intArrayOf(1..10).getOrElse(0..4) { intArrayOf(1) } // [1, 2, 3, 4, 5]
intArrayOf(1..10).getOrElse(10..14) { intArrayOf(1) } // [1]

Since

1.1.0

See also


public final static LongArray getOrElse(    LongArray $self,     IntRange indices,     Function0<LongArray> defaultValue)

Returns the sub-array from the given range if exist otherwise return else block.

Example:

longArrayOf(1..10L).getOrElse(0..4) { longArrayOf(1) } // [1L, 2L, 3L, 4L, 5L]
longArrayOf(1..10L).getOrElse(10..14) { longArrayOf(1) } // [1L]

Since

1.1.0

See also


public final static FloatArray getOrElse(    FloatArray $self,     IntRange indices,     Function0<FloatArray> defaultValue)

Returns the sub-array from the given range if exist otherwise return else block.

Example:

floatArrayOf(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f)
.getOrElse(0..4) { floatArrayOf(1.0f) } // [1.0f, 2.0f, 3.0f, 4.0f, 5.0f]
floatArrayOf(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f)
.getOrElse(10..14) { floatArrayOf(1.0f) } // [1.0f]

Since

1.1.0

See also


public final static DoubleArray getOrElse(    DoubleArray $self,     IntRange indices,     Function0<DoubleArray> defaultValue)

Returns the sub-array from the given range if exist otherwise return else block.

Example:

doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0)
.getOrElse(0..4) { doubleArrayOf(1.0) } // [1.0, 2.0, 3.0, 4.0, 5.0]
doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0)
.getOrElse(10..14) { doubleArrayOf(1.0) } // [1.0]

Since

1.1.0

See also


public final static BooleanArray getOrElse(    BooleanArray $self,     IntRange indices,     Function0<BooleanArray> defaultValue)

Returns the sub-array from the given range if exist otherwise return else block.

Example:

booleanArrayOf(true, false, true, false, true, false, true, false, true, false)
.getOrElse(0..4) { booleanArrayOf(true) } // [true, false, true, false, true]
booleanArrayOf(true, false, true, false, true, false, true, false, true, false)
.getOrElse(10..14) { booleanArrayOf(true) } // [true]

Since

1.1.0

See also


public final static Array<T> getOrElse<T extends Any>(    Array<T> $self,     IntProgression indices,     Function0<Array<T>> defaultValue)

Returns the sub-array from the given progression if exist otherwise return else block.

Example:

arrayOf(1..10).getOrElse(0..9 step 2) { arrayOf(1) } // [1, 3, 5, 7, 9]
arrayOf(1..10).getOrElse(10..14 step 2) { arrayOf(1) } // [1]

Since

1.1.0

See also


public final static ByteArray getOrElse(    ByteArray $self,     IntProgression indices,     Function0<ByteArray> defaultValue)

Returns the sub-array from the given progression if exist otherwise return else block.

Example:

byteArrayOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
.getOrElse(0..9 step 2) { byteArrayOf(1) } // [1, 3, 5, 7, 9]
byteArrayOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
.getOrElse(10..14 step 2) { byteArrayOf(1) } // [1]

Since

1.1.0

See also


public final static CharArray getOrElse(    CharArray $self,     IntProgression indices,     Function0<CharArray> defaultValue)

Returns the sub-array from the given progression if exist otherwise return else block.

Example:

charArrayOf('a'..'z').getOrElse(0..9 step 2) { charArrayOf('a') } // ['a', 'c', 'e', 'g', 'i']
charArrayOf('a'..'c').getOrElse(10..14 step 2) { charArrayOf('a') } // ['a']

Since

1.1.0

See also


public final static ShortArray getOrElse(    ShortArray $self,     IntProgression indices,     Function0<ShortArray> defaultValue)

Returns the sub-array from the given progression if exist otherwise return else block.

Example:

shortArrayOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
.getOrElse(0..9 step 2) { shortArrayOf(1) } // [1, 3, 5, 7, 9]
shortArrayOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
.getOrElse(10..14 step 2) { shortArrayOf(1) } // [1]

Since

1.1.0

See also


public final static IntArray getOrElse(    IntArray $self,     IntProgression indices,     Function0<IntArray> defaultValue)

Returns the sub-array from the given progression if exist otherwise return else block.

Example:

intArrayOf(1..10).getOrElse(0..9 step 2) { intArrayOf(1) } // [1, 3, 5, 7, 9]
intArrayOf(1..10).getOrElse(10..14 step 2) { intArrayOf(1) } // [1]

Since

1.1.0

See also


public final static LongArray getOrElse(    LongArray $self,     IntProgression indices,     Function0<LongArray> defaultValue)

Returns the sub-array from the given progression if exist otherwise return else block.

Example:

longArrayOf(1..10L).getOrElse(0..9 step 2) { longArrayOf(1) } // [1L, 3L, 5L, 7L, 9L]
longArrayOf(1..10L).getOrElse(10..14 step 2) { longArrayOf(1) } // [1L]

Since

1.1.0

See also


public final static FloatArray getOrElse(    FloatArray $self,     IntProgression indices,     Function0<FloatArray> defaultValue)

Returns the sub-array from the given progression if exist otherwise return else block.

Example:

floatArrayOf(1F, 2F, 3F, 4F, 5F, 6F, 7F, 8F, 9F, 10F)
.getOrElse(0..9 step 2) { floatArrayOf(1F) } // [1F, 3F, 5F, 7F, 9F]
floatArrayOf(1F, 2F, 3F, 4F, 5F, 6F, 7F, 8F, 9F, 10F)
.getOrElse(10..14 step 2) { floatArrayOf(1F) } // [1F]

Since

1.1.0

See also


public final static DoubleArray getOrElse(    DoubleArray $self,     IntProgression indices,     Function0<DoubleArray> defaultValue)

Returns the sub-array from the given progression if exist otherwise return else block.

Example:

doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0)
.getOrElse(0..9 step 2) { doubleArrayOf(1.0) } // [1.0, 3.0, 5.0, 7.0, 9.0]
doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0)
.getOrElse(10..14 step 2) { doubleArrayOf(1.0) } // [1.0]

Since

1.1.0

See also


public final static BooleanArray getOrElse(    BooleanArray $self,     IntProgression indices,     Function0<BooleanArray> defaultValue)

Returns the sub-array from the given progression if exist otherwise return else block.

Example:

booleanArrayOf(true, false, true, false, true, false, true, false, true, false)
.getOrElse(0..9 step 2) { booleanArrayOf(true) } // [true, true, true, true, true]
booleanArrayOf(true, false, true, false, true, false, true, false, true, false)
.getOrElse(10..14 step 2) { booleanArrayOf(true) } // [true]

Since

1.1.0

See also

+
public final static Array<T> getOrElse<T extends Any>(    Array<T> $self,     IntRange indices,     Function0<Array<T>> defaultValue)

Returns the sub-array from the given range if exist otherwise return else block.

Example:

arrayOf(1..10).getOrElse(0..4) { arrayOf(1) } // [1, 2, 3, 4, 5]
arrayOf(1..10).getOrElse(10..14) { arrayOf(1) } // [1]

Since

1.1.0

See also


public final static Array<T> getOrElse<T extends Any>(    Array<T> $self,     IntProgression indices,     Function0<Array<T>> defaultValue)

Returns the sub-array from the given progression if exist otherwise return else block.

Example:

arrayOf(1..10).getOrElse(0..9 step 2) { arrayOf(1) } // [1, 3, 5, 7, 9]
arrayOf(1..10).getOrElse(10..14 step 2) { arrayOf(1) } // [1]

Since

1.1.0

See also

-
public final static Array<T> rotateRight<T extends Any>(Array<T> $self, Integer n)

Rotates the Array to the right by specified distance.

public final static BooleanArray rotateRight(BooleanArray $self, Integer n)

Rotates the BooleanArray to the right by specified distance.

public final static ByteArray rotateRight(ByteArray $self, Integer n)

Rotates the ByteArray to the right by specified distance.

public final static CharArray rotateRight(CharArray $self, Integer n)

Rotates the CharArray to the right by specified distance.

public final static DoubleArray rotateRight(DoubleArray $self, Integer n)

Rotates the DoubleArray to the right by specified distance.

public final static FloatArray rotateRight(FloatArray $self, Integer n)

Rotates the FloatArray to the right by specified distance.

public final static IntArray rotateRight(IntArray $self, Integer n)

Rotates the IntArray to the right by specified distance.

public final static LongArray rotateRight(LongArray $self, Integer n)

Rotates the LongArray to the right by specified distance.

public final static ShortArray rotateRight(ShortArray $self, Integer n)

Rotates the ShortArray to the right by specified distance.

+
public final static BooleanArray rotateRight(BooleanArray $self)
public final static BooleanArray rotateRight(BooleanArray $self, Integer n)

Rotates the BooleanArray to the right by specified distance.

public final static ByteArray rotateRight(ByteArray $self)
public final static ByteArray rotateRight(ByteArray $self, Integer n)

Rotates the ByteArray to the right by specified distance.

public final static CharArray rotateRight(CharArray $self)
public final static CharArray rotateRight(CharArray $self, Integer n)

Rotates the CharArray to the right by specified distance.

public final static DoubleArray rotateRight(DoubleArray $self)
public final static DoubleArray rotateRight(DoubleArray $self, Integer n)

Rotates the DoubleArray to the right by specified distance.

public final static FloatArray rotateRight(FloatArray $self)
public final static FloatArray rotateRight(FloatArray $self, Integer n)

Rotates the FloatArray to the right by specified distance.

public final static IntArray rotateRight(IntArray $self)
public final static IntArray rotateRight(IntArray $self, Integer n)

Rotates the IntArray to the right by specified distance.

public final static LongArray rotateRight(LongArray $self)
public final static LongArray rotateRight(LongArray $self, Integer n)

Rotates the LongArray to the right by specified distance.

public final static ShortArray rotateRight(ShortArray $self)
public final static ShortArray rotateRight(ShortArray $self, Integer n)

Rotates the ShortArray to the right by specified distance.

public final static Array<T> rotateRight<T extends Any>(Array<T> $self, Integer n)

Rotates the Array to the right by specified distance.

@@ -312,37 +237,7 @@

Functions

-
public final static List<T> tail<T extends Any>(Array<T> $self, Integer n)

Returns a list containing last n elements.

public final static List<Boolean> tail(BooleanArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Byte> tail(ByteArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Character> tail(CharArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Double> tail(DoubleArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Float> tail(FloatArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Integer> tail(IntArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Long> tail(LongArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Short> tail(ShortArray $self, Integer n)

Returns a list containing last n elements.

-
-
- - - -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static UIntArray uintArrayOf(UIntProgression progression)

Return an un-sign integer Array from un-sign int progression.

public final static UIntArray uintArrayOf(UIntRange range)

Return an un-sign integer Array from un-sign int range.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static ULongArray ulongArrayOf(ULongProgression progression)

Return an un-sign long Array from un-sign long progression.

public final static ULongArray ulongArrayOf(ULongRange range)

Return an un-sign long Array from un-sign long range.

+
public final static List<Boolean> tail(BooleanArray $self)
public final static List<Boolean> tail(BooleanArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Byte> tail(ByteArray $self)
public final static List<Byte> tail(ByteArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Character> tail(CharArray $self)
public final static List<Character> tail(CharArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Double> tail(DoubleArray $self)
public final static List<Double> tail(DoubleArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Float> tail(FloatArray $self)
public final static List<Float> tail(FloatArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Integer> tail(IntArray $self)
public final static List<Integer> tail(IntArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Long> tail(LongArray $self)
public final static List<Long> tail(LongArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Short> tail(ShortArray $self)
public final static List<Short> tail(ShortArray $self, Integer n)

Returns a list containing last n elements.

public final static List<T> tail<T extends Any>(Array<T> $self, Integer n)

Returns a list containing last n elements.

diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/rotate-left.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/rotate-left.html index 330efff9..7092ce63 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/rotate-left.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-array-kt/rotate-left.html @@ -42,7 +42,7 @@

rotateLeft

-
public final static Array<T> rotateLeft<T extends Any>(Array<T> $self, Integer n)

Rotates the Array to the left by specified distance.

Example:

arrayOf(1, 2, 3, 4, 5).rotateLeft(2) // [4, 5, 1, 2, 3]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static ByteArray rotateLeft(ByteArray $self, Integer n)

Rotates the ByteArray to the left by specified distance.

Example:

byteArrayOf(1, 2, 3, 4, 5).rotateLeft(2) // [4, 5, 1, 2, 3]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static ShortArray rotateLeft(ShortArray $self, Integer n)

Rotates the ShortArray to the left by specified distance.

Example:

shortArrayOf(1, 2, 3, 4, 5).rotateLeft(2) // [4, 5, 1, 2, 3]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static CharArray rotateLeft(CharArray $self, Integer n)

Rotates the CharArray to the left by specified distance.

Example:

charArrayOf('a', 'b', 'c', 'd', 'e').rotateLeft(2) // ['d', 'e', 'a', 'b', 'c']

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static IntArray rotateLeft(IntArray $self, Integer n)

Rotates the IntArray to the left by specified distance.

Example:

intArrayOf(1, 2, 3, 4, 5).rotateLeft(2) // [4, 5, 1, 2, 3]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static LongArray rotateLeft(LongArray $self, Integer n)

Rotates the LongArray to the left by specified distance.

Example:

longArrayOf(1L, 2L, 3L, 4L, 5L).rotateLeft(2) // [4L, 5L, 1L, 2L, 3L]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static FloatArray rotateLeft(FloatArray $self, Integer n)

Rotates the FloatArray to the left by specified distance.

Example:

floatArrayOf(1F, 2F, 3F, 4F, 5F).rotateLeft(2) // [4F, 5F, 1F, 2F, 3F]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static DoubleArray rotateLeft(DoubleArray $self, Integer n)

Rotates the DoubleArray to the left by specified distance.

Example:

doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0).rotateLeft(2) // [4.0, 5.0, 1.0, 2.0, 3.0]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static BooleanArray rotateLeft(BooleanArray $self, Integer n)

Rotates the BooleanArray to the left by specified distance.

Example:

booleanArrayOf(true, false, true, false, true).rotateLeft(2) // [false, true, true, false, true]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.

+
public final static Array<T> rotateLeft<T extends Any>(Array<T> $self, Integer n)

Rotates the Array to the left by specified distance.

Example:

arrayOf(1, 2, 3, 4, 5).rotateLeft(2) // [4, 5, 1, 2, 3]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static ByteArray rotateLeft(ByteArray $self, Integer n)
public final static ByteArray rotateLeft(ByteArray $self)

Rotates the ByteArray to the left by specified distance.

Example:

byteArrayOf(1, 2, 3, 4, 5).rotateLeft(2) // [4, 5, 1, 2, 3]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static ShortArray rotateLeft(ShortArray $self, Integer n)
public final static ShortArray rotateLeft(ShortArray $self)

Rotates the ShortArray to the left by specified distance.

Example:

shortArrayOf(1, 2, 3, 4, 5).rotateLeft(2) // [4, 5, 1, 2, 3]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static CharArray rotateLeft(CharArray $self, Integer n)
public final static CharArray rotateLeft(CharArray $self)

Rotates the CharArray to the left by specified distance.

Example:

charArrayOf('a', 'b', 'c', 'd', 'e').rotateLeft(2) // ['d', 'e', 'a', 'b', 'c']

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static IntArray rotateLeft(IntArray $self, Integer n)
public final static IntArray rotateLeft(IntArray $self)

Rotates the IntArray to the left by specified distance.

Example:

intArrayOf(1, 2, 3, 4, 5).rotateLeft(2) // [4, 5, 1, 2, 3]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static LongArray rotateLeft(LongArray $self, Integer n)
public final static LongArray rotateLeft(LongArray $self)

Rotates the LongArray to the left by specified distance.

Example:

longArrayOf(1L, 2L, 3L, 4L, 5L).rotateLeft(2) // [4L, 5L, 1L, 2L, 3L]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static FloatArray rotateLeft(FloatArray $self, Integer n)
public final static FloatArray rotateLeft(FloatArray $self)

Rotates the FloatArray to the left by specified distance.

Example:

floatArrayOf(1F, 2F, 3F, 4F, 5F).rotateLeft(2) // [4F, 5F, 1F, 2F, 3F]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static DoubleArray rotateLeft(DoubleArray $self, Integer n)
public final static DoubleArray rotateLeft(DoubleArray $self)

Rotates the DoubleArray to the left by specified distance.

Example:

doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0).rotateLeft(2) // [4.0, 5.0, 1.0, 2.0, 3.0]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static BooleanArray rotateLeft(BooleanArray $self, Integer n)
public final static BooleanArray rotateLeft(BooleanArray $self)

Rotates the BooleanArray to the left by specified distance.

Example:

booleanArrayOf(true, false, true, false, true).rotateLeft(2) // [false, true, true, false, true]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.

- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final Integer getLastIndex()
-
-
-
-
@@ -122,21 +107,6 @@

Functions

- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static String getOrEmpty(Collection<String> $self, Integer index)

Returns an element at the given index or empty if the index is out of bounds of this string Collection.

-
-
-
-
diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/as-decimal.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/as-decimal.html new file mode 100644 index 00000000..51941531 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/as-decimal.html @@ -0,0 +1,54 @@ + + + + + asDecimal + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

asDecimal

+
+
public final String asDecimal()
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/as-hex.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/as-hex.html new file mode 100644 index 00000000..25b628ff --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/as-hex.html @@ -0,0 +1,54 @@ + + + + + asHex + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

asHex

+
+
public final String asHex()
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/as-reversed-decimal.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/as-reversed-decimal.html new file mode 100644 index 00000000..9d37fcfa --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/as-reversed-decimal.html @@ -0,0 +1,54 @@ + + + + + asReversedDecimal + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

asReversedDecimal

+
+
public final String asReversedDecimal()
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/as-reversed-hex.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/as-reversed-hex.html new file mode 100644 index 00000000..a7e2f508 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/as-reversed-hex.html @@ -0,0 +1,54 @@ + + + + + asReversedHex + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

asReversedHex

+
+
public final String asReversedHex()
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/find-pair-of-sum.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/find-pair-of-sum.html new file mode 100644 index 00000000..351e888e --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/find-pair-of-sum.html @@ -0,0 +1,54 @@ + + + + + findPairOfSum + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

findPairOfSum

+
+
public final static Pair<Integer, Integer> findPairOfSum(IntArray $self, Integer sum)

finds two numbers inside the Array from the given sum.

Example:

arrayOf(1..10).findPairOfSum(10) // (1, 9)

Since

1.1.0

See also


public final static Pair<Long, Long> findPairOfSum(LongArray $self, Long sum)

finds two numbers inside the Array from the given sum.

Example:

arrayOf(1..10L).findPairOfSum(10L) // (1L, 9L)

Since

1.1.0

See also


public final static Pair<Float, Float> findPairOfSum(FloatArray $self, Float sum)

finds two numbers inside the Array from the given sum.

Example:

arrayOf(1F, 2F, 3F, 4F, 5F).findPairOfSum(3F) // (1F, 2F)

Since

1.1.0

See also


public final static Pair<Double, Double> findPairOfSum(DoubleArray $self, Double sum)

finds two numbers inside the Array from the given sum.

Example:

arrayOf(1.0, 2.0, 3.0, 4.0, 5.0).findPairOfSum(3.0) // (1.0, 2.0)

Since

1.1.0

See also


public final static Pair<Integer, Integer> findPairOfSum(IntArray $self, Integer sum)

finds two numbers inside the IntArray from the given sum.

Example:

intArrayOf(1..10).findPairOfSum(10) // (1, 9)

Since

1.1.0

See also


public final static Pair<Long, Long> findPairOfSum(LongArray $self, Long sum)

finds two numbers inside the LongArray from the given sum.

Example:

longArrayOf(1..10L).findPairOfSum(10L) // (1L, 9L)

Since

1.1.0

See also


public final static Pair<Float, Float> findPairOfSum(FloatArray $self, Float sum)

finds two numbers inside the FloatArray from the given sum.

Example:

floatArrayOf(1F, 2F, 3F, 4F, 5F).findPairOfSum(3F) // (1F, 2F)

Since

1.1.0

See also


public final static Pair<Double, Double> findPairOfSum(DoubleArray $self, Double sum)

finds two numbers inside the DoubleArray from the given sum.

Example:

doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0).findPairOfSum(3.0) // (1.0, 2.0)

Since

1.1.0

See also


public final static Pair<Integer, Integer> findPairOfSum(Iterable<Integer> $self, Integer sum)

finds two numbers inside the Iterable from the given sum.

Example:

listOf(1..10).findPairOfSum(10) // (1, 9)

Since

1.1.0

See also


public final static Pair<Long, Long> findPairOfSum(Iterable<Long> $self, Long sum)

finds two numbers inside the Iterable from the given sum.

Example:

listOf(1..10L).findPairOfSum(10L) // (1L, 9L)

Since

1.1.0

See also


public final static Pair<Float, Float> findPairOfSum(Iterable<Float> $self, Float sum)

finds two numbers inside the Iterable from the given sum.

Example:

listOf(1F, 2F, 3F, 4F, 5F).findPairOfSum(3F) // (1F, 2F)

Since

1.1.0

See also


public final static Pair<Double, Double> findPairOfSum(Iterable<Double> $self, Double sum)

finds two numbers inside the Iterable from the given sum.

Example:

listOf(1.0, 2.0, 3.0, 4.0, 5.0).findPairOfSum(3.0) // (1.0, 2.0)

Since

1.1.0

See also

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/find-triple-of-sum.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/find-triple-of-sum.html new file mode 100644 index 00000000..b32e92f6 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/find-triple-of-sum.html @@ -0,0 +1,54 @@ + + + + + findTripleOfSum + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

findTripleOfSum

+
+
public final static Triple<Integer, Integer, Integer> findTripleOfSum(IntArray $self, Integer sum)

finds three numbers inside the Array from the given sum.

Example:

arrayOf(1..10).findTripleOfSum(6) // (1, 2, 3)

Since

1.1.0

See also


public final static Triple<Long, Long, Long> findTripleOfSum(LongArray $self, Long sum)

finds three numbers inside the Array from the given sum.

Example:

arrayOf(1..10L).findTripleOfSum(6L) // (1L, 2L, 3L)

Since

1.1.0

See also


public final static Triple<Float, Float, Float> findTripleOfSum(FloatArray $self, Float sum)

finds three numbers inside the Array from the given sum.

Example:

arrayOf(1F, 2F, 3F, 4F, 5F, 6F).findTripleOfSum(6F) // (1F, 2F, 3F)

Since

1.1.0

See also


public final static Triple<Double, Double, Double> findTripleOfSum(DoubleArray $self, Double sum)

finds three numbers inside the Array from the given sum.

Example:

arrayOf(1.0, 2.0, 3.0, 4.0, 5.0, 6.0).findTripleOfSum(6.0) // (1.0, 2.0, 3.0)

Since

1.1.0

See also


public final static Triple<Integer, Integer, Integer> findTripleOfSum(IntArray $self, Integer sum)

finds three numbers inside the IntArray from the given sum.

Example:

intArrayOf(1..10).findTripleOfSum(6) // (1, 2, 3)

Since

1.1.0

See also


public final static Triple<Long, Long, Long> findTripleOfSum(LongArray $self, Long sum)

finds three numbers inside the LongArray from the given sum.

Example:

longArrayOf(1..10L).findTripleOfSum(6L) // (1L, 2L, 3L)

Since

1.1.0

See also


public final static Triple<Float, Float, Float> findTripleOfSum(FloatArray $self, Float sum)

finds three numbers inside the FloatArray from the given sum.

Example:

floatArrayOf(1F, 2F, 3F, 4F, 5F, 6F).findTripleOfSum(6F) // (1F, 2F, 3F)

Since

1.1.0

See also


public final static Triple<Double, Double, Double> findTripleOfSum(DoubleArray $self, Double sum)

finds three numbers inside the DoubleArray from the given sum.

Example:

doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0, 6.0).findTripleOfSum(6.0) // (1.0, 2.0, 3.0)

Since

1.1.0

See also


public final static Triple<Integer, Integer, Integer> findTripleOfSum(Iterable<Integer> $self, Integer sum)

finds three numbers inside the Iterable from the given sum.

Example:

listOf(1..10).findTripleOfSum(6) // (1, 2, 3)

Since

1.1.0

See also


public final static Triple<Long, Long, Long> findTripleOfSum(Iterable<Long> $self, Long sum)

finds three numbers inside the Iterable from the given sum.

Example:

listOf(1..10L).findTripleOfSum(6L) // (1L, 2L, 3L)

Since

1.1.0

See also


public final static Triple<Float, Float, Float> findTripleOfSum(Iterable<Float> $self, Float sum)

finds three numbers inside the Iterable from the given sum.

Example:

listOf(1F, 2F, 3F, 4F, 5F, 6F).findTripleOfSum(6F) // (1F, 2F, 3F)

Since

1.1.0

See also


public final static Triple<Double, Double, Double> findTripleOfSum(Iterable<Double> $self, Double sum)

finds three numbers inside the Iterable from the given sum.

Example:

listOf(1.0, 2.0, 3.0, 4.0, 5.0, 6.0).findTripleOfSum(6.0) // (1.0, 2.0, 3.0)

Since

1.1.0

See also

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/get-or-else.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/get-or-else.html new file mode 100644 index 00000000..b15057bd --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/get-or-else.html @@ -0,0 +1,54 @@ + + + + + getOrElse + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

getOrElse

+
+
public final static Array<T> getOrElse<T extends Any>(    Array<T> $self,     IntRange indices,     Function0<Array<T>> defaultValue)

Returns the sub-array from the given range if exist otherwise return else block.

Example:

arrayOf(1..10).getOrElse(0..4) { arrayOf(1) } // [1, 2, 3, 4, 5]
arrayOf(1..10).getOrElse(10..14) { arrayOf(1) } // [1]

Since

1.1.0

See also


public final static Array<T> getOrElse<T extends Any>(    Array<T> $self,     IntProgression indices,     Function0<Array<T>> defaultValue)

Returns the sub-array from the given progression if exist otherwise return else block.

Example:

arrayOf(1..10).getOrElse(0..9 step 2) { arrayOf(1) } // [1, 3, 5, 7, 9]
arrayOf(1..10).getOrElse(10..14 step 2) { arrayOf(1) } // [1]

Since

1.1.0

See also


public final static List<T> getOrElse<T extends Any>(    Iterable<T> $self,     IntRange indices,     Function0<List<T>> defaultValue)

Returns the sub-list from the given range if exist otherwise return else block.

Example:

listOf(1..10).getOrElse(0..4) { arrayOf(1) } // [1, 2, 3, 4, 5]
listOf(1..10).getOrElse(10..14) { arrayOf(1) } // [1]

Since

1.1.0

See also


public final static List<T> getOrElse<T extends Any>(    Iterable<T> $self,     IntProgression indices,     Function0<List<T>> defaultValue)

Returns the sub-list from the given progression if exist otherwise return else block.

Example:

listOf(1..10).getOrElse(0..9 step 2) { arrayOf(1) } // [1, 3, 5, 7, 9]
listOf(1..10).getOrElse(10..14 step 2) { arrayOf(1) } // [1]

Since

1.1.0

See also

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/get-or-null.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/get-or-null.html new file mode 100644 index 00000000..87772f64 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/get-or-null.html @@ -0,0 +1,54 @@ + + + + + getOrNull + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

getOrNull

+
+
public final static Array<T> getOrNull<T extends Any>(Array<T> $self, IntRange indices)

Returns the sub-array from the given range if exist otherwise return a null.

Example:

arrayOf(1..10).getOrNull(0..4)!! // [1, 2, 3, 4, 5]
arrayOf(1..10).getOrNull(10..14) // null

Since

1.1.0

See also


public final static Array<T> getOrNull<T extends Any>(Array<T> $self, IntProgression indices)

Returns the sub-array from the given progression if exist otherwise return a null.

Example:

arrayOf(1..10).getOrNull(0..9 step 2)!! // [1, 3, 5, 7, 9]
arrayOf(1..10).getOrNull(10..14 step 2) // null

Since

1.1.0

See also


public final static List<T> getOrNull<T extends Any>(Iterable<T> $self, IntRange indices)

Returns the sub-listOf from the given range if exist otherwise return a null.

Example:

listOf(1..10).getOrNull(0..4)!! // [1, 2, 3, 4, 5]
listOf(1..10).getOrNull(10..14) // null

Since

1.1.0

See also


public final static List<T> getOrNull<T extends Any>(Iterable<T> $self, IntProgression indices)

Returns the sub-list from the given progression if exist otherwise return a null.

Example:

listOf(1..10).getOrNull(0..9 step 2)!! // [1, 3, 5, 7, 9]
listOf(1..10).getOrNull(10..14 step 2) // null

Since

1.1.0

See also

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/get.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/get.html new file mode 100644 index 00000000..816a0350 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/get.html @@ -0,0 +1,54 @@ + + + + + get + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

get

+
+
public final static Array<T> get<T extends Any>(Array<T> $self, IntRange indices)

Returns the sub-array from the given range.

Example:

arrayOf(1..10)[0..4] // [1, 2, 3, 4, 5]

Since

1.1.0

See also

Throws

if the range is out of bounds of the array.


public final static Array<T> get<T extends Any>(Array<T> $self, IntProgression indices)

Returns the sub-array from the given progression.

Example:

arrayOf(1..10)[0..9 step 2] // [1, 3, 5, 7, 9]

Since

1.1.0

See also

Throws

if the range is out of bounds of the array.


public final static List<T> get<T extends Any>(Iterable<T> $self, IntRange indices)

Returns the sub-list from the given range.

Example:

listOf(1..10)[0..4] // [1, 2, 3, 4, 5]

Since

1.1.0

See also

Throws

if the range is out of bounds of the array.


public final static List<T> get<T extends Any>(Iterable<T> $self, IntProgression indices)

Returns the sub-list from the given progression.

Example:

listOf(1..10)[0..9 step 2] // [1, 3, 5, 7, 9]

Since

1.1.0

See also

Throws

if the range is out of bounds of the array.

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/head.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/head.html new file mode 100644 index 00000000..143ccaa1 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/head.html @@ -0,0 +1,54 @@ + + + + + head + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

head

+
+
public final static List<T> head<T extends Any>(Array<T> $self, Integer n)

Returns a list containing first n elements.

Example:

arrayOf(1..10).head(3) // [1, 2, 3]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Byte> head(ByteArray $self, Integer n)
public final static List<Byte> head(ByteArray $self)

Returns a list containing first n elements.

Example:

byteArrayOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10).head(3) // [1, 2, 3]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Character> head(CharArray $self, Integer n)
public final static List<Character> head(CharArray $self)

Returns a list containing first n elements.

Example:

charArrayOf('a'..'z').head(3) // ['a', 'b', 'c']

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Short> head(ShortArray $self, Integer n)
public final static List<Short> head(ShortArray $self)

Returns a list containing first n elements.

Example:

shortArrayOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10).head(3) // [1, 2, 3]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Integer> head(IntArray $self, Integer n)
public final static List<Integer> head(IntArray $self)

Returns a list containing first n elements.

Example:

intArrayOf(1..10).head(3) // [1, 2, 3]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Long> head(LongArray $self, Integer n)
public final static List<Long> head(LongArray $self)

Returns a list containing first n elements.

Example:

longArrayOf(1..10L).head(3) // [1L, 2L, 3L]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Float> head(FloatArray $self, Integer n)
public final static List<Float> head(FloatArray $self)

Returns a list containing first n elements.

Example:

floatArrayOf(1F, 2F, 3F, 4F, 5F, 6F, 7F, 8F, 9F, 10F).head(3) // [1F, 2F, 3F]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Double> head(DoubleArray $self, Integer n)
public final static List<Double> head(DoubleArray $self)

Returns a list containing first n elements.

Example:

doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0).head(3) // [1.0, 2.0, 3.0]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Boolean> head(BooleanArray $self, Integer n)
public final static List<Boolean> head(BooleanArray $self)

Returns a list containing first n elements.

Example:

booleanArrayOf(true, false, true, false, true).head(3) // [true, false, true]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<T> head<T extends Any>(Iterable<T> $self, Integer n)

Returns a list containing first n elements.

Example:

listOf(1..10).head(3) // [1, 2, 3]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/index.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/index.html new file mode 100644 index 00000000..5ae608d5 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/index.html @@ -0,0 +1,363 @@ + + + + + CollectionsUtils + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

CollectionsUtils

+
public final class CollectionsUtils
+
+
+
+
+

Functions

+
+
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final String asDecimal()
+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final String asHex()
+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final String asReversedDecimal()
+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final String asReversedHex()
+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static Pair<Double, Double> findPairOfSum(DoubleArray $self, Double sum)
public final static Pair<Float, Float> findPairOfSum(FloatArray $self, Float sum)
public final static Pair<Integer, Integer> findPairOfSum(IntArray $self, Integer sum)
public final static Pair<Long, Long> findPairOfSum(LongArray $self, Long sum)

finds two numbers inside the Array from the given sum.

public final static Pair<Double, Double> findPairOfSum(DoubleArray $self, Double sum)

finds two numbers inside the DoubleArray from the given sum.

public final static Pair<Float, Float> findPairOfSum(FloatArray $self, Float sum)

finds two numbers inside the FloatArray from the given sum.

public final static Pair<Integer, Integer> findPairOfSum(IntArray $self, Integer sum)

finds two numbers inside the IntArray from the given sum.

public final static Pair<Long, Long> findPairOfSum(LongArray $self, Long sum)

finds two numbers inside the LongArray from the given sum.

public final static Pair<Double, Double> findPairOfSum(Iterable<Double> $self, Double sum)
public final static Pair<Float, Float> findPairOfSum(Iterable<Float> $self, Float sum)
public final static Pair<Integer, Integer> findPairOfSum(Iterable<Integer> $self, Integer sum)
public final static Pair<Long, Long> findPairOfSum(Iterable<Long> $self, Long sum)

finds two numbers inside the Iterable from the given sum.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static Triple<Double, Double, Double> findTripleOfSum(DoubleArray $self, Double sum)
public final static Triple<Float, Float, Float> findTripleOfSum(FloatArray $self, Float sum)
public final static Triple<Integer, Integer, Integer> findTripleOfSum(IntArray $self, Integer sum)
public final static Triple<Long, Long, Long> findTripleOfSum(LongArray $self, Long sum)

finds three numbers inside the Array from the given sum.

public final static Triple<Double, Double, Double> findTripleOfSum(DoubleArray $self, Double sum)

finds three numbers inside the DoubleArray from the given sum.

public final static Triple<Float, Float, Float> findTripleOfSum(FloatArray $self, Float sum)

finds three numbers inside the FloatArray from the given sum.

public final static Triple<Integer, Integer, Integer> findTripleOfSum(IntArray $self, Integer sum)

finds three numbers inside the IntArray from the given sum.

public final static Triple<Long, Long, Long> findTripleOfSum(LongArray $self, Long sum)

finds three numbers inside the LongArray from the given sum.

public final static Triple<Double, Double, Double> findTripleOfSum(Iterable<Double> $self, Double sum)
public final static Triple<Float, Float, Float> findTripleOfSum(Iterable<Float> $self, Float sum)
public final static Triple<Integer, Integer, Integer> findTripleOfSum(Iterable<Integer> $self, Integer sum)
public final static Triple<Long, Long, Long> findTripleOfSum(Iterable<Long> $self, Long sum)

finds three numbers inside the Iterable from the given sum.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static Array<T> get<T extends Any>(Array<T> $self, IntProgression indices)

Returns the sub-array from the given progression.

public final static Array<T> get<T extends Any>(Array<T> $self, IntRange indices)

Returns the sub-array from the given range.

public final static List<T> get<T extends Any>(Iterable<T> $self, IntProgression indices)

Returns the sub-list from the given progression.

public final static List<T> get<T extends Any>(Iterable<T> $self, IntRange indices)

Returns the sub-list from the given range.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static Array<T> getOrElse<T extends Any>(    Array<T> $self,     IntProgression indices,     Function0<Array<T>> defaultValue)

Returns the sub-array from the given progression if exist otherwise return else block.

public final static Array<T> getOrElse<T extends Any>(    Array<T> $self,     IntRange indices,     Function0<Array<T>> defaultValue)

Returns the sub-array from the given range if exist otherwise return else block.

public final static List<T> getOrElse<T extends Any>(    Iterable<T> $self,     IntProgression indices,     Function0<List<T>> defaultValue)

Returns the sub-list from the given progression if exist otherwise return else block.

public final static List<T> getOrElse<T extends Any>(    Iterable<T> $self,     IntRange indices,     Function0<List<T>> defaultValue)

Returns the sub-list from the given range if exist otherwise return else block.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static Array<T> getOrNull<T extends Any>(Array<T> $self, IntProgression indices)

Returns the sub-array from the given progression if exist otherwise return a null.

public final static Array<T> getOrNull<T extends Any>(Array<T> $self, IntRange indices)

Returns the sub-array from the given range if exist otherwise return a null.

public final static List<T> getOrNull<T extends Any>(Iterable<T> $self, IntProgression indices)

Returns the sub-list from the given progression if exist otherwise return a null.

public final static List<T> getOrNull<T extends Any>(Iterable<T> $self, IntRange indices)

Returns the sub-listOf from the given range if exist otherwise return a null.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static List<Boolean> head(BooleanArray $self)
public final static List<Boolean> head(BooleanArray $self, Integer n)

Returns a list containing first n elements.

public final static List<Byte> head(ByteArray $self)
public final static List<Byte> head(ByteArray $self, Integer n)

Returns a list containing first n elements.

public final static List<Character> head(CharArray $self)
public final static List<Character> head(CharArray $self, Integer n)

Returns a list containing first n elements.

public final static List<Double> head(DoubleArray $self)
public final static List<Double> head(DoubleArray $self, Integer n)

Returns a list containing first n elements.

public final static List<Float> head(FloatArray $self)
public final static List<Float> head(FloatArray $self, Integer n)

Returns a list containing first n elements.

public final static List<Integer> head(IntArray $self)
public final static List<Integer> head(IntArray $self, Integer n)

Returns a list containing first n elements.

public final static List<Long> head(LongArray $self)
public final static List<Long> head(LongArray $self, Integer n)

Returns a list containing first n elements.

public final static List<Short> head(ShortArray $self)
public final static List<Short> head(ShortArray $self, Integer n)

Returns a list containing first n elements.

public final static List<T> head<T extends Any>(Array<T> $self, Integer n)

Returns a list containing first n elements.

public final static List<T> head<T extends Any>(Iterable<T> $self, Integer n)

Returns a list containing first n elements.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static BooleanArray rotateLeft(BooleanArray $self)
public final static BooleanArray rotateLeft(BooleanArray $self, Integer n)

Rotates the BooleanArray to the left by specified distance.

public final static ByteArray rotateLeft(ByteArray $self)
public final static ByteArray rotateLeft(ByteArray $self, Integer n)

Rotates the ByteArray to the left by specified distance.

public final static CharArray rotateLeft(CharArray $self)
public final static CharArray rotateLeft(CharArray $self, Integer n)

Rotates the CharArray to the left by specified distance.

public final static DoubleArray rotateLeft(DoubleArray $self)
public final static DoubleArray rotateLeft(DoubleArray $self, Integer n)

Rotates the DoubleArray to the left by specified distance.

public final static FloatArray rotateLeft(FloatArray $self)
public final static FloatArray rotateLeft(FloatArray $self, Integer n)

Rotates the FloatArray to the left by specified distance.

public final static IntArray rotateLeft(IntArray $self)
public final static IntArray rotateLeft(IntArray $self, Integer n)

Rotates the IntArray to the left by specified distance.

public final static LongArray rotateLeft(LongArray $self)
public final static LongArray rotateLeft(LongArray $self, Integer n)

Rotates the LongArray to the left by specified distance.

public final static ShortArray rotateLeft(ShortArray $self)
public final static ShortArray rotateLeft(ShortArray $self, Integer n)

Rotates the ShortArray to the left by specified distance.

public final static Array<T> rotateLeft<T extends Any>(Array<T> $self, Integer n)

Rotates the Array to the left by specified distance.

public final static List<T> rotateLeft<T extends Any>(Iterable<T> $self, Integer n)

Rotates the Iterable to the left by specified distance.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static BooleanArray rotateRight(BooleanArray $self)
public final static BooleanArray rotateRight(BooleanArray $self, Integer n)

Rotates the BooleanArray to the right by specified distance.

public final static ByteArray rotateRight(ByteArray $self)
public final static ByteArray rotateRight(ByteArray $self, Integer n)

Rotates the ByteArray to the right by specified distance.

public final static CharArray rotateRight(CharArray $self)
public final static CharArray rotateRight(CharArray $self, Integer n)

Rotates the CharArray to the right by specified distance.

public final static DoubleArray rotateRight(DoubleArray $self)
public final static DoubleArray rotateRight(DoubleArray $self, Integer n)

Rotates the DoubleArray to the right by specified distance.

public final static FloatArray rotateRight(FloatArray $self)
public final static FloatArray rotateRight(FloatArray $self, Integer n)

Rotates the FloatArray to the right by specified distance.

public final static IntArray rotateRight(IntArray $self)
public final static IntArray rotateRight(IntArray $self, Integer n)

Rotates the IntArray to the right by specified distance.

public final static LongArray rotateRight(LongArray $self)
public final static LongArray rotateRight(LongArray $self, Integer n)

Rotates the LongArray to the right by specified distance.

public final static ShortArray rotateRight(ShortArray $self)
public final static ShortArray rotateRight(ShortArray $self, Integer n)

Rotates the ShortArray to the right by specified distance.

public final static Array<T> rotateRight<T extends Any>(Array<T> $self, Integer n)

Rotates the Array to the right by specified distance.

public final static List<T> rotateRight<T extends Any>(Iterable<T> $self, Integer n)

Rotates the Iterable to the right by specified distance.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static List<Boolean> tail(BooleanArray $self)
public final static List<Boolean> tail(BooleanArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Byte> tail(ByteArray $self)
public final static List<Byte> tail(ByteArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Character> tail(CharArray $self)
public final static List<Character> tail(CharArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Double> tail(DoubleArray $self)
public final static List<Double> tail(DoubleArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Float> tail(FloatArray $self)
public final static List<Float> tail(FloatArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Integer> tail(IntArray $self)
public final static List<Integer> tail(IntArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Long> tail(LongArray $self)
public final static List<Long> tail(LongArray $self, Integer n)

Returns a list containing last n elements.

public final static List<Short> tail(ShortArray $self)
public final static List<Short> tail(ShortArray $self, Integer n)

Returns a list containing last n elements.

public final static List<T> tail<T extends Any>(Array<T> $self, Integer n)

Returns a list containing last n elements.

public final static List<T> tail<T extends Any>(Iterable<T> $self, Integer n)

Returns a list containing last n elements.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static ArrayList<T> toArrayList<T extends Any>(Iterable<T> $self)

Returns a ArrayList containing all elements.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static LinkedList<T> toLinkedList<T extends Any>(Iterable<T> $self)

Returns a LinkedList containing all elements.

+
+
+
+
+
+

Properties

+
+
+
+
+ + +
Link copied to clipboard
+
+
+
+
private final static String asDecimal

Convert ByteArray to String decimal.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
private final static String asHex

Convert ByteArray to String HEX.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
private final static String asReversedDecimal

Convert ByteArray to String reversed decimal.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
private final static String asReversedHex

Convert ByteArray to String reversed HEX.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
private final static Integer lastIndex

Returns the last index of Collection.

+
+
+
+
+
+
+
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/rotate-left.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/rotate-left.html new file mode 100644 index 00000000..bbc350ca --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/rotate-left.html @@ -0,0 +1,54 @@ + + + + + rotateLeft + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

rotateLeft

+
+
public final static Array<T> rotateLeft<T extends Any>(Array<T> $self, Integer n)

Rotates the Array to the left by specified distance.

Example:

arrayOf(1, 2, 3, 4, 5).rotateLeft(2) // [4, 5, 1, 2, 3]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static ByteArray rotateLeft(ByteArray $self, Integer n)
public final static ByteArray rotateLeft(ByteArray $self)

Rotates the ByteArray to the left by specified distance.

Example:

byteArrayOf(1, 2, 3, 4, 5).rotateLeft(2) // [4, 5, 1, 2, 3]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static ShortArray rotateLeft(ShortArray $self, Integer n)
public final static ShortArray rotateLeft(ShortArray $self)

Rotates the ShortArray to the left by specified distance.

Example:

shortArrayOf(1, 2, 3, 4, 5).rotateLeft(2) // [4, 5, 1, 2, 3]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static CharArray rotateLeft(CharArray $self, Integer n)
public final static CharArray rotateLeft(CharArray $self)

Rotates the CharArray to the left by specified distance.

Example:

charArrayOf('a', 'b', 'c', 'd', 'e').rotateLeft(2) // ['d', 'e', 'a', 'b', 'c']

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static IntArray rotateLeft(IntArray $self, Integer n)
public final static IntArray rotateLeft(IntArray $self)

Rotates the IntArray to the left by specified distance.

Example:

intArrayOf(1, 2, 3, 4, 5).rotateLeft(2) // [4, 5, 1, 2, 3]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static LongArray rotateLeft(LongArray $self, Integer n)
public final static LongArray rotateLeft(LongArray $self)

Rotates the LongArray to the left by specified distance.

Example:

longArrayOf(1L, 2L, 3L, 4L, 5L).rotateLeft(2) // [4L, 5L, 1L, 2L, 3L]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static FloatArray rotateLeft(FloatArray $self, Integer n)
public final static FloatArray rotateLeft(FloatArray $self)

Rotates the FloatArray to the left by specified distance.

Example:

floatArrayOf(1F, 2F, 3F, 4F, 5F).rotateLeft(2) // [4F, 5F, 1F, 2F, 3F]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static DoubleArray rotateLeft(DoubleArray $self, Integer n)
public final static DoubleArray rotateLeft(DoubleArray $self)

Rotates the DoubleArray to the left by specified distance.

Example:

doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0).rotateLeft(2) // [4.0, 5.0, 1.0, 2.0, 3.0]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static BooleanArray rotateLeft(BooleanArray $self, Integer n)
public final static BooleanArray rotateLeft(BooleanArray $self)

Rotates the BooleanArray to the left by specified distance.

Example:

booleanArrayOf(true, false, true, false, true).rotateLeft(2) // [false, true, true, false, true]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static List<T> rotateLeft<T extends Any>(Iterable<T> $self, Integer n)

Rotates the Iterable to the left by specified distance.

Example:

listOf(1, 2, 3, 4, 5).rotateLeft(2) // [4, 5, 1, 2, 3]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/rotate-right.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/rotate-right.html new file mode 100644 index 00000000..0478453d --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/rotate-right.html @@ -0,0 +1,54 @@ + + + + + rotateRight + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

rotateRight

+
+
public final static Array<T> rotateRight<T extends Any>(Array<T> $self, Integer n)

Rotates the Array to the right by specified distance.

Example:

arrayOf(1, 2, 3, 4, 5).rotateRight(2) // [3, 4, 5, 1, 2]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static ByteArray rotateRight(ByteArray $self, Integer n)
public final static ByteArray rotateRight(ByteArray $self)

Rotates the ByteArray to the right by specified distance.

Example:

byteArrayOf(1, 2, 3, 4, 5).rotateRight(2) // [3, 4, 5, 1, 2]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static ShortArray rotateRight(ShortArray $self, Integer n)
public final static ShortArray rotateRight(ShortArray $self)

Rotates the ShortArray to the right by specified distance.

Example:

shortArrayOf(1, 2, 3, 4, 5).rotateRight(2) // [3, 4, 5, 1, 2]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static CharArray rotateRight(CharArray $self, Integer n)
public final static CharArray rotateRight(CharArray $self)

Rotates the CharArray to the right by specified distance.

Example:

charArrayOf('a', 'b', 'c', 'd', 'e').rotateRight(2) // ['c', 'd', 'e', 'a', 'b']

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static IntArray rotateRight(IntArray $self, Integer n)
public final static IntArray rotateRight(IntArray $self)

Rotates the IntArray to the right by specified distance.

Example:

intArrayOf(1, 2, 3, 4, 5).rotateRight(2) // [3, 4, 5, 1, 2]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static LongArray rotateRight(LongArray $self, Integer n)
public final static LongArray rotateRight(LongArray $self)

Rotates the LongArray to the right by specified distance.

Example:

longArrayOf(1L, 2L, 3L, 4L, 5L).rotateRight(2) // [3L, 4L, 5L, 1L, 2L]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static FloatArray rotateRight(FloatArray $self, Integer n)
public final static FloatArray rotateRight(FloatArray $self)

Rotates the FloatArray to the right by specified distance.

Example:

floatArrayOf(1F, 2F, 3F, 4F, 5F).rotateRight(2) // [3F, 4F, 5F, 1F, 2F]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static DoubleArray rotateRight(DoubleArray $self, Integer n)
public final static DoubleArray rotateRight(DoubleArray $self)

Rotates the DoubleArray to the right by specified distance.

Example:

doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0).rotateRight(2) // [3.0, 4.0, 5.0, 1.0, 2.0]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static BooleanArray rotateRight(BooleanArray $self, Integer n)
public final static BooleanArray rotateRight(BooleanArray $self)

Rotates the BooleanArray to the right by specified distance.

Example:

booleanArrayOf(true, false, true, false, true).rotateRight(2) // [true, false, true, true, false]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.


public final static List<T> rotateRight<T extends Any>(Iterable<T> $self, Integer n)

Rotates the Iterable to the right by specified distance.

Example:

listOf(1, 2, 3, 4, 5).rotateRight(2) // [3, 4, 5, 1, 2]

Since

1.1.0

See also

Parameters

n

number of elements rotate

Throws

if n is negative or zero.

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/tail.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/tail.html new file mode 100644 index 00000000..1cd4ef80 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/tail.html @@ -0,0 +1,54 @@ + + + + + tail + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

tail

+
+
public final static List<T> tail<T extends Any>(Array<T> $self, Integer n)

Returns a list containing last n elements.

Example:

arrayOf(1..10).tail(3) // [8, 9, 10]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Byte> tail(ByteArray $self, Integer n)
public final static List<Byte> tail(ByteArray $self)

Returns a list containing last n elements.

Example:

byteArrayOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10).tail(3) // [8, 9, 10]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Character> tail(CharArray $self, Integer n)
public final static List<Character> tail(CharArray $self)

Returns a list containing last n elements.

Example:

charArrayOf('a'..'z').tail(3) // [x, y, z]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Short> tail(ShortArray $self, Integer n)
public final static List<Short> tail(ShortArray $self)

Returns a list containing last n elements.

Example:

shortArrayOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10).tail(3) // [8, 9, 10]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Integer> tail(IntArray $self, Integer n)
public final static List<Integer> tail(IntArray $self)

Returns a list containing last n elements.

Example:

intArrayOf(1..10).tail(3) // [8, 9, 10]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Long> tail(LongArray $self, Integer n)
public final static List<Long> tail(LongArray $self)

Returns a list containing last n elements.

Example:

longArrayOf(1..10L).tail(3) // [8L, 9L, 10L]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Float> tail(FloatArray $self, Integer n)
public final static List<Float> tail(FloatArray $self)

Returns a list containing last n elements.

Example:

floatArrayOf(1F, 2F, 3F, 4F, 5F, 6F, 7F, 8F, 9F, 10F).tail(3) // [8F, 9F, 10F]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Double> tail(DoubleArray $self, Integer n)
public final static List<Double> tail(DoubleArray $self)

Returns a list containing last n elements.

Example:

doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0).tail(3) // [8.0, 9.0, 10.0]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<Boolean> tail(BooleanArray $self, Integer n)
public final static List<Boolean> tail(BooleanArray $self)

Returns a list containing last n elements.

Example:

booleanArrayOf(true, false, true, false, true).tail(3) // [true, false, true]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws


public final static List<T> tail<T extends Any>(Iterable<T> $self, Integer n)

Returns a list containing last n elements.

Example:

listOf(1..10).tail(3) // [8, 9, 10]

Since

1.1.0

Return

sublist

See also

Parameters

n

number of elements return

Throws

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/to-array-list.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/to-array-list.html new file mode 100644 index 00000000..296a2e34 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/to-array-list.html @@ -0,0 +1,54 @@ + + + + + toArrayList + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

toArrayList

+
+
public final static ArrayList<T> toArrayList<T extends Any>(Iterable<T> $self)

Returns a ArrayList containing all elements.

Example:

(1..10).toArrayList() // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Since

1.1.0

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/to-linked-list.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/to-linked-list.html new file mode 100644 index 00000000..18f77ae4 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-collections-utils/to-linked-list.html @@ -0,0 +1,54 @@ + + + + + toLinkedList + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

toLinkedList

+
+
public final static LinkedList<T> toLinkedList<T extends Any>(Iterable<T> $self)

Returns a LinkedList containing all elements.

Example:

(1..10).toLinkedList() // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Since

1.1.0

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-list-kt/index.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-list-kt/index.html index 5d08b36d..f113b235 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-list-kt/index.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-list-kt/index.html @@ -62,21 +62,6 @@

Functions

- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static ArrayList<Character> arrayListOf(CharProgression progression)

Return a char ArrayList from char progression.

public final static ArrayList<Character> arrayListOf(CharRange range)

Return a char ArrayList from char range.

public final static ArrayList<Integer> arrayListOf(IntProgression progression)

Return an integer ArrayList from int progression.

public final static ArrayList<Integer> arrayListOf(IntRange range)

Return an integer ArrayList from int range.

public final static ArrayList<Long> arrayListOf(LongProgression progression)

Return a long ArrayList from long progression.

public final static ArrayList<Long> arrayListOf(LongRange range)

Return a long ArrayList from long range.

public final static ArrayList<UInt> arrayListOf(UIntProgression progression)

Return an un-sign integer ArrayList from un-sign int progression.

public final static ArrayList<UInt> arrayListOf(UIntRange range)

Return an un-sign integer ArrayList from un-sign int range.

public final static ArrayList<ULong> arrayListOf(ULongProgression progression)

Return an un-sign long ArrayList from un-sign long progression.

public final static ArrayList<ULong> arrayListOf(ULongRange range)

Return an un-sign long ArrayList from un-sign long range.

-
-
-
-
@@ -107,47 +92,17 @@

Functions

- +
- -
Link copied to clipboard
-
-
-
-
public final static LinkedList<T> linkedListOf<T extends Any>()

Return an empty new LinkedList.

public final static LinkedList<T> linkedListOf<T extends Any>(T elements)

Returns a LinkedList of given elements.

public final static LinkedList<Character> linkedListOf(CharProgression progression)

Return a char LinkedList from char progression.

public final static LinkedList<Character> linkedListOf(CharRange range)

Return a char LinkedList from char range.

public final static LinkedList<Integer> linkedListOf(IntProgression progression)

Return an integer LinkedList from int progression.

public final static LinkedList<Integer> linkedListOf(IntRange range)

Return an integer LinkedList from int range.

public final static LinkedList<Long> linkedListOf(LongProgression progression)

Return a long LinkedList from long progression.

public final static LinkedList<Long> linkedListOf(LongRange range)

Return a long LinkedList from long range.

public final static LinkedList<UInt> linkedListOf(UIntProgression progression)

Return an un-sign integer LinkedList from un-sign int progression.

public final static LinkedList<UInt> linkedListOf(UIntRange range)

Return an un-sign integer LinkedList from un-sign int range.

public final static LinkedList<ULong> linkedListOf(ULongProgression progression)

Return an un-sign long LinkedList from un-sign long progression.

public final static LinkedList<ULong> linkedListOf(ULongRange range)

Return an un-sign long LinkedList from un-sign long range.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static List<Character> listOf(CharProgression progression)

Return a char List from char progression.

public final static List<Character> listOf(CharRange range)

Return a char List from char range.

public final static List<Integer> listOf(IntProgression progression)

Return an integer List from int progression.

public final static List<Integer> listOf(IntRange range)

Return an integer List from int range.

public final static List<Long> listOf(LongProgression progression)

Return a long List from long progression.

public final static List<Long> listOf(LongRange range)

Return a long List from long range.

public final static List<UInt> listOf(UIntProgression progression)

Return an un-sign integer List from un-sign int progression.

public final static List<UInt> listOf(UIntRange range)

Return an un-sign integer List from un-sign int range.

public final static List<ULong> listOf(ULongProgression progression)

Return an un-sign long List from un-sign long progression.

public final static List<ULong> listOf(ULongRange range)

Return an un-sign long List from un-sign long range.

-
-
-
-
- -
-
-
- - +
Link copied to clipboard
-
public final static List<Character> mutableListOf(CharProgression progression)

Return a char MutableList from char progression.

public final static List<Character> mutableListOf(CharRange range)

Return a char MutableList from char range.

public final static List<Integer> mutableListOf(IntProgression progression)

Return an integer MutableList from int progression.

public final static List<Integer> mutableListOf(IntRange range)

Return an integer MutableList from int range.

public final static List<Long> mutableListOf(LongProgression progression)

Return a long MutableList from long progression.

public final static List<Long> mutableListOf(LongRange range)

Return a long MutableList from long range.

public final static List<UInt> mutableListOf(UIntProgression progression)

Return an un-sign integer MutableList from un-sign int progression.

public final static List<UInt> mutableListOf(UIntRange range)

Return an un-sign integer MutableList from un-sign int range.

public final static List<ULong> mutableListOf(ULongProgression progression)

Return an un-sign long MutableList from un-sign long progression.

public final static List<ULong> mutableListOf(ULongRange range)

Return an un-sign long MutableList from un-sign long range.

+
public final static LinkedList<T> linkedListOf<T extends Any>()

Return an empty new LinkedList.

public final static LinkedList<T> linkedListOf<T extends Any>(T elements)

Returns a LinkedList of given elements.

diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-list-kt/linked-list-of.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-list-kt/linked-list-of.html index f0c3647b..a8be32f2 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-list-kt/linked-list-of.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-list-kt/linked-list-of.html @@ -42,7 +42,7 @@

linkedListOf

-
public final static LinkedList<T> linkedListOf<T extends Any>()

Return an empty new LinkedList.

Since

1.1.0


public final static LinkedList<T> linkedListOf<T extends Any>(T elements)

Returns a LinkedList of given elements.

Since

1.1.0


public final static LinkedList<Integer> linkedListOf(IntRange range)

Return an integer LinkedList from int range.

Example:

linkedListOf(1..10) // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Since

1.1.0

See also


public final static LinkedList<UInt> linkedListOf(UIntRange range)

Return an un-sign integer LinkedList from un-sign int range.

Example:

linkedListOf(1u..10u) // [1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u]

Since

1.1.0

See also


public final static LinkedList<Long> linkedListOf(LongRange range)

Return a long LinkedList from long range.

Example:

linkedListOf(1..10L) // [1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L]

Since

1.1.0

See also


public final static LinkedList<ULong> linkedListOf(ULongRange range)

Return an un-sign long LinkedList from un-sign long range.

Example:

linkedListOf(1uL..10uL) // [1ul, 2uL, 3uL, 4uL, 5uL, 6uL, 7uL, 8uL, 9uL, 10uL]

Since

1.1.0

See also


public final static LinkedList<Integer> linkedListOf(IntProgression progression)

Return an integer LinkedList from int progression.

Example:

linkedListOf(1..10 step 2) // [1, 3, 5, 7, 9]

Since

1.1.0

See also


public final static LinkedList<UInt> linkedListOf(UIntProgression progression)

Return an un-sign integer LinkedList from un-sign int progression.

Example:

linkedListOf(1u..10u step 2) // [1u, 3u, 5u, 7u, 9u]

Since

1.1.0

See also


public final static LinkedList<Long> linkedListOf(LongProgression progression)

Return a long LinkedList from long progression.

Example:

linkedListOf(1..10L step 2) // [1L, 3L, 5L, 7L, 9L]

Since

1.1.0

See also


public final static LinkedList<ULong> linkedListOf(ULongProgression progression)

Return an un-sign long LinkedList from un-sign long progression.

Example:

linkedListOf(1uL..10uL step 2) // [1ul, 3uL, 5uL, 7uL, 9uL]

Since

1.1.0

See also


public final static LinkedList<Character> linkedListOf(CharRange range)

Return a char LinkedList from char range.

Example:

linkedListOf('a'..'f') // ['a', 'b', 'c', 'd', 'e', 'f']

Since

1.1.0

See also


public final static LinkedList<Character> linkedListOf(CharProgression progression)

Return a char LinkedList from char progression.

Example:

linkedListOf('a'..'f' step 2) // ['a', 'c', 'e']

Since

1.1.0

See also

+
public final static LinkedList<T> linkedListOf<T extends Any>()

Return an empty new LinkedList.

Since

1.1.0


public final static LinkedList<T> linkedListOf<T extends Any>(T elements)

Returns a LinkedList of given elements.

Since

1.1.0

- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static HashSet<Character> hashSetOf(CharProgression progression)

Return a char HashSet from char progression.

public final static HashSet<Character> hashSetOf(CharRange range)

Return a char HashSet from char range.

public final static HashSet<Integer> hashSetOf(IntProgression progression)

Return an integer HashSet from int progression.

public final static HashSet<Integer> hashSetOf(IntRange range)

Return an integer HashSet from int range.

public final static HashSet<Long> hashSetOf(LongProgression progression)

Return a long HashSet from long progression.

public final static HashSet<Long> hashSetOf(LongRange range)

Return a long HashSet from long range.

public final static HashSet<UInt> hashSetOf(UIntProgression progression)

Return an un-sign integer HashSet from un-sign int progression.

public final static HashSet<UInt> hashSetOf(UIntRange range)

Return an un-sign integer HashSet from un-sign int range.

public final static HashSet<ULong> hashSetOf(ULongProgression progression)

Return an un-sign long HashSet from un-sign long progression.

public final static HashSet<ULong> hashSetOf(ULongRange range)

Return an un-sign long HashSet from un-sign long range.

-
-
-
-
@@ -152,66 +137,6 @@

Functions

- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LinkedHashSet<Character> linkedSetOf(CharProgression progression)

Return a char LinkedHashSet from char progression.

public final static LinkedHashSet<Character> linkedSetOf(CharRange range)

Return a char LinkedHashSet from char range.

public final static LinkedHashSet<Integer> linkedSetOf(IntProgression progression)

Return an integer LinkedHashSet from int progression.

public final static LinkedHashSet<Integer> linkedSetOf(IntRange range)

Return an integer LinkedHashSet from int range.

public final static LinkedHashSet<Long> linkedSetOf(LongProgression progression)

Return a long LinkedHashSet from long progression.

public final static LinkedHashSet<Long> linkedSetOf(LongRange range)

Return a long LinkedHashSet from long range.

public final static LinkedHashSet<UInt> linkedSetOf(UIntProgression progression)

Return an un-sign integer LinkedHashSet from un-sign int progression.

public final static LinkedHashSet<UInt> linkedSetOf(UIntRange range)

Return an un-sign integer LinkedHashSet from un-sign int range.

public final static LinkedHashSet<ULong> linkedSetOf(ULongProgression progression)

Return an un-sign long LinkedHashSet from un-sign long progression.

public final static LinkedHashSet<ULong> linkedSetOf(ULongRange range)

Return an un-sign long LinkedHashSet from un-sign long range.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Set<Character> mutableSetOf(CharProgression progression)

Return a char MutableSet from char progression.

public final static Set<Character> mutableSetOf(CharRange range)

Return a char MutableSet from char range.

public final static Set<Integer> mutableSetOf(IntProgression progression)

Return an integer MutableSet from int progression.

public final static Set<Integer> mutableSetOf(IntRange range)

Return an integer MutableSet from int range.

public final static Set<Long> mutableSetOf(LongProgression progression)

Return a long MutableSet from long progression.

public final static Set<Long> mutableSetOf(LongRange range)

Return a long MutableSet from long range.

public final static Set<UInt> mutableSetOf(UIntProgression progression)

Return an un-sign integer MutableSet from un-sign int progression.

public final static Set<UInt> mutableSetOf(UIntRange range)

Return an un-sign integer MutableSet from un-sign int range.

public final static Set<ULong> mutableSetOf(ULongProgression progression)

Return an un-sign long MutableSet from un-sign long progression.

public final static Set<ULong> mutableSetOf(ULongRange range)

Return an un-sign long MutableSet from un-sign long range.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Set<Character> setOf(CharProgression progression)

Return a char Set from char progression.

public final static Set<Character> setOf(CharRange range)

Return a char Set from char range.

public final static Set<Integer> setOf(IntProgression progression)

Return an integer Set from int progression.

public final static Set<Integer> setOf(IntRange range)

Return an integer Set from int range.

public final static Set<Long> setOf(LongProgression progression)

Return a long Set from long progression.

public final static Set<Long> setOf(LongRange range)

Return a long Set from long range.

public final static Set<UInt> setOf(UIntProgression progression)

Return an un-sign integer Set from un-sign int progression.

public final static Set<UInt> setOf(UIntRange range)

Return an un-sign integer Set from un-sign int range.

public final static Set<ULong> setOf(ULongProgression progression)

Return an un-sign long Set from un-sign long progression.

public final static Set<ULong> setOf(ULongRange range)

Return an un-sign long Set from un-sign long range.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static TreeSet<Character> sortedSetOf(CharProgression progression)

Return a char TreeSet from char progression.

public final static TreeSet<Character> sortedSetOf(CharRange range)

Return a char TreeSet from char range.

public final static TreeSet<Integer> sortedSetOf(IntProgression progression)

Return an integer TreeSet from int progression.

public final static TreeSet<Integer> sortedSetOf(IntRange range)

Return an integer TreeSet from int range.

public final static TreeSet<Long> sortedSetOf(LongProgression progression)

Return a long TreeSet from long progression.

public final static TreeSet<Long> sortedSetOf(LongRange range)

Return a long TreeSet from long range.

public final static TreeSet<UInt> sortedSetOf(UIntProgression progression)

Return an un-sign integer TreeSet from un-sign int progression.

public final static TreeSet<UInt> sortedSetOf(UIntRange range)

Return an un-sign integer TreeSet from un-sign int range.

public final static TreeSet<ULong> sortedSetOf(ULongProgression progression)

Return an un-sign long TreeSet from un-sign long progression.

public final static TreeSet<ULong> sortedSetOf(ULongRange range)

Return an un-sign long TreeSet from un-sign long range.

-
-
-
-
diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-stack-kt/index.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-stack-kt/index.html index 4d8795c6..1a803a81 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-stack-kt/index.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-stack-kt/index.html @@ -62,17 +62,17 @@

Functions

- +
- +
Link copied to clipboard
-
public final static Stack<T> stackOf<T extends Any>()

Return an empty new Stack.

public final static Stack<T> stackOf<T extends Any>(T elements)

Returns a Stack of given elements.

public final static Stack<Character> stackOf(CharProgression progression)

Return a char Stack from char progression.

public final static Stack<Character> stackOf(CharRange range)

Return a char Stack from char range.

public final static Stack<Integer> stackOf(IntProgression progression)

Return an integer Stack from int progression.

public final static Stack<Integer> stackOf(IntRange range)

Return an integer Stack from int range.

public final static Stack<Long> stackOf(LongProgression progression)

Return a long Stack from long progression.

public final static Stack<Long> stackOf(LongRange range)

Return a long Stack from long range.

public final static Stack<UInt> stackOf(UIntProgression progression)

Return an un-sign integer Stack from un-sign int progression.

public final static Stack<UInt> stackOf(UIntRange range)

Return an un-sign integer Stack from un-sign int range.

public final static Stack<ULong> stackOf(ULongProgression progression)

Return an un-sign long Stack from un-sign long progression.

public final static Stack<ULong> stackOf(ULongRange range)

Return an un-sign long Stack from un-sign long range.

+
public final static Stack<T> stackOf<T extends Any>()

Return an empty new Stack.

public final static Stack<T> stackOf<T extends Any>(T elements)

Returns a Stack of given elements.

diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-stack-kt/stack-of.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-stack-kt/stack-of.html index 4d6c942b..611a6f45 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-stack-kt/stack-of.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-stack-kt/stack-of.html @@ -42,7 +42,7 @@

stackOf

-
public final static Stack<T> stackOf<T extends Any>()

Return an empty new Stack.

Since

1.1.0


public final static Stack<T> stackOf<T extends Any>(T elements)

Returns a Stack of given elements.

Since

1.1.0


public final static Stack<Integer> stackOf(IntRange range)

Return an integer Stack from int range.

Example:

stackOf(1..10) // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Since

1.1.0


public final static Stack<UInt> stackOf(UIntRange range)

Return an un-sign integer Stack from un-sign int range.

Example:

stackOf(1u..10u) // [1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u]

Since

1.1.0


public final static Stack<Long> stackOf(LongRange range)

Return a long Stack from long range.

Example:

stackOf(1..10L) // [1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L]

Since

1.1.0


public final static Stack<ULong> stackOf(ULongRange range)

Return an un-sign long Stack from un-sign long range.

Example:

stackOf(1uL..10uL) // [1ul, 2uL, 3uL, 4uL, 5uL, 6uL, 7uL, 8uL, 9uL, 10uL]

Since

1.1.0


public final static Stack<Integer> stackOf(IntProgression progression)

Return an integer Stack from int progression.

Example:

stackOf(1..10 step 2) // [1, 3, 5, 7, 9]

Since

1.1.0


public final static Stack<UInt> stackOf(UIntProgression progression)

Return an un-sign integer Stack from un-sign int progression.

Example:

stackOf(1u..10u step 2) // [1u, 3u, 5u, 7u, 9u]

Since

1.1.0


public final static Stack<Long> stackOf(LongProgression progression)

Return a long Stack from long progression.

Example:

stackOf(1..10L step 2) // [1L, 3L, 5L, 7L, 9L]

Since

1.1.0


public final static Stack<ULong> stackOf(ULongProgression progression)

Return an un-sign long Stack from un-sign long progression.

Example:

stackOf(1uL..10uL step 2) // [1ul, 3uL, 5uL, 7uL, 9uL]

Since

1.1.0


public final static Stack<Character> stackOf(CharRange range)

Return a char Stack from char range.

Example:

stackOf('a'..'f') // ['a', 'b', 'c', 'd', 'e', 'f']

Since

1.1.0


public final static Stack<Character> stackOf(CharProgression progression)

Return a char Stack from char progression.

Example:

stackOf('a'..'f' step 2) // ['a', 'c', 'e']

Since

1.1.0

+
public final static Stack<T> stackOf<T extends Any>()

Return an empty new Stack.

Since

1.1.0


public final static Stack<T> stackOf<T extends Any>(T elements)

Returns a Stack of given elements.

Since

1.1.0

- +
- +
Link copied to clipboard
-
public final static Vector<T> vectorOf<T extends Any>(T elements)

Returns a Vector of given elements.

public final static Vector<Character> vectorOf(CharProgression progression)

Return a char Vector from char progression.

public final static Vector<Character> vectorOf(CharRange range)

Return a char Vector from char range.

public final static Vector<Integer> vectorOf(IntProgression progression)

Return an integer Vector from int progression.

public final static Vector<Integer> vectorOf(IntRange range)

Return an integer Vector from int range.

public final static Vector<Long> vectorOf(LongProgression progression)

Return a long Vector from long progression.

public final static Vector<Long> vectorOf(LongRange range)

Return a long Vector from long range.

public final static Vector<UInt> vectorOf(UIntProgression progression)

Return an un-sign integer Vector from un-sign int progression.

public final static Vector<UInt> vectorOf(UIntRange range)

Return an un-sign integer Vector from un-sign int range.

public final static Vector<ULong> vectorOf(ULongProgression progression)

Return an un-sign long Vector from un-sign long progression.

public final static Vector<ULong> vectorOf(ULongRange range)

Return an un-sign long Vector from un-sign long range.

public final static Vector<T> vectorOf<T extends Any>(Integer size, Integer incrementStep)

Return an empty new Vector.

+
public final static Vector<T> vectorOf<T extends Any>(T elements)

Returns a Vector of given elements.

public final static Vector<T> vectorOf<T extends Any>(Integer size, Integer incrementStep)

Return an empty new Vector.

diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-vector-kt/vector-of.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-vector-kt/vector-of.html index 8d25dc02..93035c3a 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-vector-kt/vector-of.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.collections/-vector-kt/vector-of.html @@ -42,7 +42,7 @@

vectorOf

-
public final static Vector<T> vectorOf<T extends Any>(Integer size, Integer incrementStep)

Return an empty new Vector.

Since

1.1.0

Parameters

size

default size is 10

incrementStep

default step to increment size is zero


public final static Vector<T> vectorOf<T extends Any>(T elements)

Returns a Vector of given elements.

Since

1.1.0


public final static Vector<Integer> vectorOf(IntRange range)

Return an integer Vector from int range.

Example:

vectorOf(1..10) // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Since

1.1.0


public final static Vector<UInt> vectorOf(UIntRange range)

Return an un-sign integer Vector from un-sign int range.

Example:

vectorOf(1u..10u) // [1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u]

Since

1.1.0


public final static Vector<Long> vectorOf(LongRange range)

Return a long Vector from long range.

Example:

vectorOf(1..10L) // [1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L]

Since

1.1.0


public final static Vector<ULong> vectorOf(ULongRange range)

Return an un-sign long Vector from un-sign long range.

Example:

vectorOf(1uL..10uL) // [1ul, 2uL, 3uL, 4uL, 5uL, 6uL, 7uL, 8uL, 9uL, 10uL]

Since

1.1.0


public final static Vector<Integer> vectorOf(IntProgression progression)

Return an integer Vector from int progression.

Example:

vectorOf(1..10 step 2) // [1, 3, 5, 7, 9]

Since

1.1.0


public final static Vector<UInt> vectorOf(UIntProgression progression)

Return an un-sign integer Vector from un-sign int progression.

Example:

vectorOf(1u..10u step 2) // [1u, 3u, 5u, 7u, 9u]

Since

1.1.0


public final static Vector<Long> vectorOf(LongProgression progression)

Return a long Vector from long progression.

Example:

vectorOf(1..10L step 2) // [1L, 3L, 5L, 7L, 9L]

Since

1.1.0


public final static Vector<ULong> vectorOf(ULongProgression progression)

Return an un-sign long Vector from un-sign long progression.

Example:

vectorOf(1uL..10uL step 2) // [1ul, 3uL, 5uL, 7uL, 9uL]

Since

1.1.0


public final static Vector<Character> vectorOf(CharRange range)

Return a char Vector from char range.

Example:

vectorOf('a'..'f') // ['a', 'b', 'c', 'd', 'e', 'f']

Since

1.1.0


public final static Vector<Character> vectorOf(CharProgression progression)

Return a char Vector from char progression.

Example:

vectorOf('a'..'f' step 2) // ['a', 'c', 'e']

Since

1.1.0

+
public final static Vector<T> vectorOf<T extends Any>(Integer size, Integer incrementStep)

Return an empty new Vector.

Since

1.1.0

Parameters

size

default size is 10

incrementStep

default step to increment size is zero


public final static Vector<T> vectorOf<T extends Any>(T elements)

Returns a Vector of given elements.

Since

1.1.0

@@ -347,51 +122,6 @@

Functions

- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDate toLocalDate(Calendar $self)

Convert Calendar to LocalDate.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDateTime toLocalDateTime(Calendar $self)

Convert Calendar to LocalDateTime.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalTime toLocalTime(Calendar $self)

Convert Calendar to LocalTime.

-
-
-
-
@@ -402,7 +132,7 @@

Functions

-
public final static String toString(Calendar $self, String format)

Formats a Calendar into a date-time String.

+
@Deprecated(message = "This function is deprecated and will be removed in next major release.Use format() instead.", replaceWith = @ReplaceWith(imports = {"com.parsuomash.affogato.core.ktx.datetime.format"}, expression = "format(format)"), level = DeprecationLevel.WARNING)
public final static String toString(Calendar $self, String format)

Formats a Calendar into a date-time String.

diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.datetime/-calendar-kt/to-calendar-or-null.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.datetime/-calendar-kt/to-calendar-or-null.html index a099c16d..1a144e8a 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.datetime/-calendar-kt/to-calendar-or-null.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.datetime/-calendar-kt/to-calendar-or-null.html @@ -42,7 +42,7 @@

toCalendarOrNull

-
public final static Calendar toCalendarOrNull(String $self, String pattern)

Produce a Calendar from the given strings value and pattern if possible.

Since

1.1.0

Return

A nullable Calendar parsed from the string.

See also

+
public final static Calendar toCalendarOrNull(String $self, String pattern)
public final static Calendar toCalendarOrNull(String $self)

Produce a Calendar from the given strings value and pattern if possible.

Since

1.1.0

Return

A nullable Calendar parsed from the string.

See also

- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Date minus(Date $self, Date other)

Subtracts the other value from this value.

public final static Date minus(Date $self, Duration other)

Subtracts the Duration value from this Date.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Date plus(Date $self, Date other)

Adds the other value to this value.

public final static Date plus(Date $self, Duration other)

Adds the Duration value to this Date.

-
-
-
-
@@ -122,17 +92,17 @@

Functions

- +
- +
Link copied to clipboard
-
public final static Date toDate(Long $self)

Convert Long to Date.

public final static Date toDate(Duration $self)

Convert Duration to Date.

public final static Date toDate(String $self, String pattern)

Produce a date from the given strings value and pattern.

+
public final static Date toDate(Long $self)

Convert Long to Date.

public final static Date toDate(String $self)
public final static Date toDate(String $self, String pattern)

Produce a date from the given strings value and pattern.

@@ -147,52 +117,7 @@

Functions

-
public final static Date toDateOrNull(String $self, String pattern)

Produce a date from the given strings value and pattern if possible.

-
-
- - - -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDate toLocalDate(Date $self)

Convert Date to LocalDate.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDateTime toLocalDateTime(Date $self)

Convert Date to LocalDateTime.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalTime toLocalTime(Date $self)

Convert Date to LocalTime.

+
public final static Date toDateOrNull(String $self)
public final static Date toDateOrNull(String $self, String pattern)

Produce a date from the given strings value and pattern if possible.

diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.datetime/-date-kt/to-date-or-null.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.datetime/-date-kt/to-date-or-null.html index 9b6cb296..464ecffb 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.datetime/-date-kt/to-date-or-null.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.datetime/-date-kt/to-date-or-null.html @@ -42,7 +42,7 @@

toDateOrNull

-
public final static Date toDateOrNull(String $self, String pattern)

Produce a date from the given strings value and pattern if possible.

Example:

"8/7/2022".toDateOrNull("MM/dd/yyyy") // Sun Aug 07 00:00:00 IRDT 2022
"Sun Aug 07 16:37:42 IRDT 2022".toDateOrNull() // Sun Aug 07 16:37:42 IRDT 2022
"7/2022".toDateOrNull("MM/dd/yyyy") // null

Since

1.1.0

Return

A nullable Date parsed from the string.

See also

+
public final static Date toDateOrNull(String $self, String pattern)
public final static Date toDateOrNull(String $self)

Produce a date from the given strings value and pattern if possible.

Example:

"8/7/2022".toDateOrNull("MM/dd/yyyy") // Sun Aug 07 00:00:00 IRDT 2022
"Sun Aug 07 16:37:42 IRDT 2022".toDateOrNull() // Sun Aug 07 16:37:42 IRDT 2022
"7/2022".toDateOrNull("MM/dd/yyyy") // null

Since

1.1.0

Return

A nullable Date parsed from the string.

See also

-
-
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static String format(Instant $self, String pattern)

Formats a Instant into a date-time String.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Boolean isSameDay(Instant $self, Instant date)

Two days are considered to be the same if they have the same day.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Calendar toCalendar(Instant $self)

Convert Instant to Calendar.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Date toDate(Instant $self)

Convert Instant to Date.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Instant toInstant(Long $self)

Convert Long to Instant.

public final static Instant toInstant(String $self, String pattern)

Produce an Instant from the given strings value and pattern.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Instant toInstantOrNull(String $self, String pattern)

Produce an Instant from the given strings value and pattern if possible.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDate toLocalDate(Instant $self, TimeZone timeZone)

Convert Instant to LocalDate.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalTime toLocalTime(Instant $self, TimeZone timeZone)

Convert Instant to LocalTime.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
@Deprecated(message = "This function is deprecated and will be removed in next major release.Use format() instead.", replaceWith = @ReplaceWith(imports = {"com.parsuomash.affogato.core.ktx.datetime.format"}, expression = "format(format)"), level = DeprecationLevel.WARNING)
public final static String toString(Instant $self, String format)

Formats a Instant into a date-time String.

-
-
-
-
-
-
+
+
-
-
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static String format(LocalDate $self, String pattern)

Formats a LocalDate into a date-time String.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Boolean isSameDay(LocalDate $self, LocalDate date)

Two days are considered to be the same if they have the same day.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDate minus(LocalDate $self, Duration duration)

Subtracts the other value from this value.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDate now(LocalDate.Companion $self, TimeZone timeZone)

Get current LocalDate.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDate plus(LocalDate $self, Duration duration)

Adds the other value to this value.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Calendar toCalendar(LocalDate $self)

Convert LocalDate to Calendar.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Date toDate(LocalDate $self)

Convert LocalDate to Date.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDate toLocalDate(Long $self)

Convert Long to LocalDate.

public final static LocalDate toLocalDate(String $self, String pattern)

Produce a LocalDate from the given strings value and pattern.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDate toLocalDateOrNull(String $self, String pattern)

Produce a LocalDate from the given strings value and pattern if possible.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDateTime toLocalDateTime(LocalDate $self)

Convert LocalDate to LocalDateTime.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
@Deprecated(message = "This function is deprecated and will be removed in next major release.Use format() instead.", replaceWith = @ReplaceWith(imports = {"com.parsuomash.affogato.core.ktx.datetime.format"}, expression = "format(format)"), level = DeprecationLevel.WARNING)
public final static String toString(LocalDate $self, String format)

Formats a LocalDate into a date-time String.

-
-
-
-
-
-
+
+
-
-
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static String format(LocalDateTime $self, String pattern)

Formats a LocalDateTime into a date-time String.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Boolean isSameDay(LocalDateTime $self, LocalDateTime date)

Two days are considered to be the same if they have the same day.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDateTime minus(LocalDateTime $self, Duration duration)

Subtracts the other value from this value.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDateTime now(LocalDateTime.Companion $self, TimeZone timeZone)

Get current LocalDateTime.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDateTime plus(LocalDateTime $self, Duration duration)

Adds the other value to this value.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Calendar toCalendar(LocalDateTime $self)

Convert LocalDateTime to Calendar.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Date toDate(LocalDateTime $self)

Convert LocalDateTime to Date.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDate toLocalDate(LocalDateTime $self)

Convert LocalDateTime to LocalDate.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDateTime toLocalDateTime(Long $self)

Convert Long to LocalDateTime.

public final static LocalDateTime toLocalDateTime(String $self, String pattern)

Produce a LocalDateTime from the given strings value and pattern.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDateTime toLocalDateTimeOrNull(String $self, String pattern)

Produce a LocalDateTime from the given strings value and pattern if possible.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalTime toLocalTime(LocalDateTime $self)

Convert LocalDateTime to LocalTime.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
@Deprecated(message = "This function is deprecated and will be removed in next major release.Use format() instead.", replaceWith = @ReplaceWith(imports = {"com.parsuomash.affogato.core.ktx.datetime.format"}, expression = "format(format)"), level = DeprecationLevel.WARNING)
public final static String toString(LocalDateTime $self, String format)

Formats a LocalDateTime into a date-time String.

-
-
-
-
-
-
+
+
-
-
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static String format(LocalTime $self, String pattern)

Formats a LocalTime into a date-time String.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalTime minus(LocalTime $self, Duration duration)

Subtracts the other value from this value.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalTime now(LocalTime.Companion $self, TimeZone timeZone)

Get current LocalTime.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalTime plus(LocalTime $self, Duration duration)

Adds the other value to this value.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Calendar toCalendar(LocalTime $self)

Convert LocalTime to Calendar.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Date toDate(LocalTime $self)

Convert LocalTime to Date.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalTime toLocalTime(Long $self)

Convert Long to LocalTime.

public final static LocalTime toLocalTime(String $self, String pattern)

Produce a LocalTime from the given strings value and pattern.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalTime toLocalTimeOrNull(String $self, String pattern)

Produce a LocalTime from the given strings value and pattern if possible.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
@Deprecated(message = "This function is deprecated and will be removed in next major release.Use format() instead.", replaceWith = @ReplaceWith(imports = {"com.parsuomash.affogato.core.ktx.datetime.format"}, expression = "format(format)"), level = DeprecationLevel.WARNING)
public final static String toString(LocalTime $self, String format)

Formats a LocalTime into a date-time String.

-
-
-
-
-
-
+
+
-
+
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
public final BigDecimal getBD()
public final BigDecimal getBD()
public final BigDecimal getBD()
public final BigDecimal getBD()
public final BigDecimal getBD()
-
-
-
-
-

Properties

diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.math/-big-integer-kt/index.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.math/-big-integer-kt/index.html index a9944605..cda5ba68 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.math/-big-integer-kt/index.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.math/-big-integer-kt/index.html @@ -44,25 +44,8 @@

BigIntegerKt
public final class BigIntegerKt

-
+
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
public final BigInteger getBI()
public final BigInteger getBI()
-
-
-
-
-

Properties

diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.math/-math-kt/as-degrees.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.math/-math-kt/as-degrees.html new file mode 100644 index 00000000..0d390bf3 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.math/-math-kt/as-degrees.html @@ -0,0 +1,54 @@ + + + + + asDegrees + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

asDegrees

+
+
public final Float asDegrees()
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.math/-math-kt/as-radians.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.math/-math-kt/as-radians.html new file mode 100644 index 00000000..cb81541d --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.math/-math-kt/as-radians.html @@ -0,0 +1,54 @@ + + + + + asRadians + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

asRadians

+
+
public final Float asRadians()
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.math/-math-kt/fact.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.math/-math-kt/fact.html index e494d88a..76f85edb 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.math/-math-kt/fact.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.math/-math-kt/fact.html @@ -42,7 +42,7 @@

fact

-
public final static Long fact(Long n, Long run)

Calculate factorial of n.

Example:

fact(5) // 120L

Since

1.1.0

+
public final static Long fact(Long n, Long run)
public final static Long fact(Long n)

Calculate factorial of n.

Example:

fact(5) // 120L

Since

1.1.0

@@ -102,97 +102,37 @@

Functions

-
public final static List<T> choicesOrNull<T extends Any>(    Random $self,     Array<T> array,     List<Integer> weights,     Integer length)

Returns a random list from this array using the specified source of randomness, or null if this array is empty.

public final static List<T> choicesOrNull<T extends Any>(    Random $self,     Collection<T> collection,     List<Integer> weights,     Integer length)

Returns a random list from this collection using the specified source of randomness, or null if this collection is empty.

+
public final static List<T> choicesOrNull<T extends Any>(Random $self, Array<T> array)
public final static List<T> choicesOrNull<T extends Any>(    Random $self,     Array<T> array,     List<Integer> weights)
public final static List<T> choicesOrNull<T extends Any>(    Random $self,     Array<T> array,     List<Integer> weights,     Integer length)

Returns a random list from this array using the specified source of randomness, or null if this array is empty.

public final static List<T> choicesOrNull<T extends Any>(Random $self, Collection<T> collection)
public final static List<T> choicesOrNull<T extends Any>(    Random $self,     Collection<T> collection,     List<Integer> weights)
public final static List<T> choicesOrNull<T extends Any>(    Random $self,     Collection<T> collection,     List<Integer> weights,     Integer length)

Returns a random list from this collection using the specified source of randomness, or null if this collection is empty.

- +
- - + +
Link copied to clipboard
-
public final static List<T> choicesVars<T extends Any>(    Random $self,     T elements,     List<Integer> weights,     Integer length)

Returns a random list from this array using the specified source of randomness.

+
public final static List<T> choicesVararg<T extends Any>(Random $self, T elements)
public final static List<T> choicesVararg<T extends Any>(    Random $self,     T elements,     List<Integer> weights)
public final static List<T> choicesVararg<T extends Any>(    Random $self,     T elements,     List<Integer> weights,     Integer length)

Returns a random list from this array using the specified source of randomness.

- +
- - + +
Link copied to clipboard
-
public final static T choiceVars<T extends Any>(Random $self, T elements)

Returns a random element from this array using the specified source of randomness.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Integer nextInt(Random $self, IntProgression progression)

Gets the next random Int from the random number generator in the specified progression. Generates an Int random value uniformly distributed in the specified progression.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Long nextLong(Random $self, LongProgression progression)

Gets the next random Long from the random number generator in the specified progression. Generates a Long random value uniformly distributed in the specified progression.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static UInt nextUInt(Random $self, UIntProgression progression)

Gets the next random UInt from the random number generator in the specified progression. Generates an UInt random value uniformly distributed in the specified progression.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static ULong nextULong(Random $self, ULongProgression progression)

Gets the next random ULong from the random number generator in the specified progression. Generates a ULong random value uniformly distributed in the specified progression.

+
public final static T choiceVararg<T extends Any>(Random $self, T elements)

Returns a random element from this array using the specified source of randomness.

diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choice-or-null.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choice-or-null.html new file mode 100644 index 00000000..d6fd7c70 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choice-or-null.html @@ -0,0 +1,54 @@ + + + + + choiceOrNull + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

choiceOrNull

+
+
public final static T choiceOrNull<T extends Any>(Random $self, Array<T> array)

Returns a random element from this array using the specified source of randomness, or null if this array is empty.

Example:

Random.choiceOrNull(arrayOf(1..5)) // a number in the range 1..5
Random.choiceOrNull(arrayOf()) // null

Since

1.1.0

See also


public final static T choiceOrNull<T extends Any>(Random $self, Collection<T> collection)

Returns a random element from this collection using the specified source of randomness, or null if this collection is empty.

Example:

Random.choiceOrNull(listOf(1..5)) // a number in the range 1..5
Random.choiceOrNull(listOf()) // null

Since

1.1.0

See also


public final static Pair<T, K> choiceOrNull<T extends Any, K extends Any>(Random $self, Map<T, K> map)

Returns a random element from this map using the specified source of randomness, or null if this map is empty.

Example:

Random.choice(mapOf(1 to 1, 2 to 2, 3 to 3, 4 to 4, 5 to 5)) // a pair from this map
Random.choice(mapOf()) // null

Since

1.1.0

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choice-vararg.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choice-vararg.html new file mode 100644 index 00000000..a88ee045 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choice-vararg.html @@ -0,0 +1,54 @@ + + + + + choiceVararg + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

choiceVararg

+
+
public final static T choiceVararg<T extends Any>(Random $self, T elements)

Returns a random element from this array using the specified source of randomness.

Example:

Random.choice(1, 2, 3, 4, 5) // a number in the range 1..5

Since

1.1.0

See also

Throws

  • if this array is empty.

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choice.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choice.html new file mode 100644 index 00000000..85c277a2 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choice.html @@ -0,0 +1,54 @@ + + + + + choice + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

choice

+
+
public final static T choice<T extends Any>(Random $self, Array<T> array)

Returns a random element from this array using the specified source of randomness.

Example:

Random.choice(arrayOf(1..5)) // a number in the range 1..5

Since

1.1.0

See also

Throws

  • if this array is empty.


public final static T choice<T extends Any>(Random $self, Collection<T> collection)

Returns a random element from this collection using the specified source of randomness.

Example:

Random.choice(listOf(1..5)) // a number in the range 1..5

Since

1.1.0

See also

Throws

  • if this collection is empty.


public final static Pair<T, K> choice<T extends Any, K extends Any>(Random $self, Map<T, K> map)

Returns a random element from this map using the specified source of randomness.

Example:

Random.choice(mapOf(1 to 1, 2 to 2, 3 to 3, 4 to 4, 5 to 5)) // a pair from this map

Since

1.1.0

Throws

  • if this map is empty.

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choices-or-null.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choices-or-null.html new file mode 100644 index 00000000..17e102cf --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choices-or-null.html @@ -0,0 +1,54 @@ + + + + + choicesOrNull + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

choicesOrNull

+
+
public final static List<T> choicesOrNull<T extends Any>(    Random $self,     Array<T> array,     List<Integer> weights,     Integer length)
public final static List<T> choicesOrNull<T extends Any>(    Random $self,     Array<T> array,     List<Integer> weights)
public final static List<T> choicesOrNull<T extends Any>(Random $self, Array<T> array)

Returns a random list from this array using the specified source of randomness, or null if this array is empty.

Since

1.1.0

Return

randomness list

See also

Parameters

array
weights

A list were you can weigh the possibility for each value. (Optional)

length

An integer defining the length of the returned list. (Optional)


public final static List<T> choicesOrNull<T extends Any>(    Random $self,     Collection<T> collection,     List<Integer> weights,     Integer length)
public final static List<T> choicesOrNull<T extends Any>(    Random $self,     Collection<T> collection,     List<Integer> weights)
public final static List<T> choicesOrNull<T extends Any>(Random $self, Collection<T> collection)

Returns a random list from this collection using the specified source of randomness, or null if this collection is empty.

Since

1.1.0

Return

randomness list

See also

Parameters

collection
weights

A list were you can weigh the possibility for each value. (Optional)

length

An integer defining the length of the returned list. (Optional)

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choices-vararg.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choices-vararg.html new file mode 100644 index 00000000..67b638fb --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choices-vararg.html @@ -0,0 +1,54 @@ + + + + + choicesVararg + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

choicesVararg

+
+
public final static List<T> choicesVararg<T extends Any>(    Random $self,     T elements,     List<Integer> weights,     Integer length)
public final static List<T> choicesVararg<T extends Any>(    Random $self,     T elements,     List<Integer> weights)
public final static List<T> choicesVararg<T extends Any>(Random $self, T elements)

Returns a random list from this array using the specified source of randomness.

Since

1.1.0

Return

randomness list

See also

Parameters

elements
weights

A list were you can weigh the possibility for each value. (Optional)

length

An integer defining the length of the returned list. (Optional)

Throws

if this array is empty.

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choices.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choices.html new file mode 100644 index 00000000..59f5c3f4 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/choices.html @@ -0,0 +1,54 @@ + + + + + choices + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

choices

+
+
public final static List<T> choices<T extends Any>(    Random $self,     Array<T> array,     List<Integer> weights,     Integer length)
public final static List<T> choices<T extends Any>(    Random $self,     Array<T> array,     List<Integer> weights)
public final static List<T> choices<T extends Any>(Random $self, Array<T> array)

Returns a random list from this array using the specified source of randomness.

Since

1.1.0

Return

randomness list

See also

Parameters

array
weights

A list were you can weigh the possibility for each value. (Optional)

length

An integer defining the length of the returned list. (Optional)

Throws

if this array is empty.


public final static List<T> choices<T extends Any>(    Random $self,     Collection<T> collection,     List<Integer> weights,     Integer length)
public final static List<T> choices<T extends Any>(    Random $self,     Collection<T> collection,     List<Integer> weights)
public final static List<T> choices<T extends Any>(Random $self, Collection<T> collection)

Returns a random list from this collection using the specified source of randomness.

Since

1.1.0

Return

randomness list

See also

Parameters

collection
weights

A list were you can weigh the possibility for each value. (Optional)

length

An integer defining the length of the returned list. (Optional)

Throws

if this collection is empty.

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/index.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/index.html new file mode 100644 index 00000000..e6a69a67 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/index.html @@ -0,0 +1,181 @@ + + + + + RandomUtils + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

RandomUtils

+
public final class RandomUtils
+
+
+
+
+

Functions

+
+
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static T choice<T extends Any>(Random $self, Array<T> array)

Returns a random element from this array using the specified source of randomness.

public final static T choice<T extends Any>(Random $self, Collection<T> collection)

Returns a random element from this collection using the specified source of randomness.

public final static Pair<T, K> choice<T extends Any, K extends Any>(Random $self, Map<T, K> map)

Returns a random element from this map using the specified source of randomness.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static T choiceOrNull<T extends Any>(Random $self, Array<T> array)

Returns a random element from this array using the specified source of randomness, or null if this array is empty.

public final static T choiceOrNull<T extends Any>(Random $self, Collection<T> collection)

Returns a random element from this collection using the specified source of randomness, or null if this collection is empty.

public final static Pair<T, K> choiceOrNull<T extends Any, K extends Any>(Random $self, Map<T, K> map)

Returns a random element from this map using the specified source of randomness, or null if this map is empty.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static List<T> choices<T extends Any>(Random $self, Array<T> array)
public final static List<T> choices<T extends Any>(    Random $self,     Array<T> array,     List<Integer> weights)
public final static List<T> choices<T extends Any>(    Random $self,     Array<T> array,     List<Integer> weights,     Integer length)

Returns a random list from this array using the specified source of randomness.

public final static List<T> choices<T extends Any>(Random $self, Collection<T> collection)
public final static List<T> choices<T extends Any>(    Random $self,     Collection<T> collection,     List<Integer> weights)
public final static List<T> choices<T extends Any>(    Random $self,     Collection<T> collection,     List<Integer> weights,     Integer length)

Returns a random list from this collection using the specified source of randomness.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static List<T> choicesOrNull<T extends Any>(Random $self, Array<T> array)
public final static List<T> choicesOrNull<T extends Any>(    Random $self,     Array<T> array,     List<Integer> weights)
public final static List<T> choicesOrNull<T extends Any>(    Random $self,     Array<T> array,     List<Integer> weights,     Integer length)

Returns a random list from this array using the specified source of randomness, or null if this array is empty.

public final static List<T> choicesOrNull<T extends Any>(Random $self, Collection<T> collection)
public final static List<T> choicesOrNull<T extends Any>(    Random $self,     Collection<T> collection,     List<Integer> weights)
public final static List<T> choicesOrNull<T extends Any>(    Random $self,     Collection<T> collection,     List<Integer> weights,     Integer length)

Returns a random list from this collection using the specified source of randomness, or null if this collection is empty.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static List<T> choicesVararg<T extends Any>(Random $self, T elements)
public final static List<T> choicesVararg<T extends Any>(    Random $self,     T elements,     List<Integer> weights)
public final static List<T> choicesVararg<T extends Any>(    Random $self,     T elements,     List<Integer> weights,     Integer length)

Returns a random list from this array using the specified source of randomness.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static T choiceVararg<T extends Any>(Random $self, T elements)

Returns a random element from this array using the specified source of randomness.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static Pair<K, V> random<K extends Any, V extends Any>(Map<K, V> $self)

Returns a random element from this map using the specified source of randomness.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static Pair<K, V> randomOrNull<K extends Any, V extends Any>(Map<K, V> $self)

Returns a random element from this map using the specified source of randomness, or null if this map is empty.

+
+
+
+
+
+
+
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/random-or-null.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/random-or-null.html new file mode 100644 index 00000000..4e41fa0b --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/random-or-null.html @@ -0,0 +1,54 @@ + + + + + randomOrNull + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

randomOrNull

+
+
public final static Pair<K, V> randomOrNull<K extends Any, V extends Any>(Map<K, V> $self)

Returns a random element from this map using the specified source of randomness, or null if this map is empty.

Example:

mapOf(1 to 1, 2 to 2, 3 to 3, 4 to 4, 5 to 5).randomOrNull() // a pair from this map
mapOf().randomOrNull() // null

Since

1.1.0

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/random.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/random.html new file mode 100644 index 00000000..2dfab7d3 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.random/-random-utils/random.html @@ -0,0 +1,54 @@ + + + + + random + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

random

+
+
public final static Pair<K, V> random<K extends Any, V extends Any>(Map<K, V> $self)

Returns a random element from this map using the specified source of randomness.

Example:

mapOf(1 to 1, 2 to 2, 3 to 3, 4 to 4, 5 to 5).random() // a pair from this map

Since

1.1.0

Throws

  • if this map is empty.

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-kt/format-credit-card.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-kt/format-credit-card.html index 539eea1b..e8217456 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-kt/format-credit-card.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-kt/format-credit-card.html @@ -42,7 +42,7 @@

formatCreditCard

-
public final static String formatCreditCard(    String $self,     String separator,     Integer separatorDigit)

Format string as credit card number.

Example:

"1234567890123456".formatCreditCard(separator = "-") // 1234-5678-9012-3456
"1234567890123456".formatCreditCard() // 1234 5678 9012 3456

Since

1.1.0

Return

formatted credit card number.

+
public final static String formatCreditCard(    String $self,     String separator,     Integer separatorDigit)
public final static String formatCreditCard(String $self, String separator)
public final static String formatCreditCard(String $self)

Format string as credit card number.

Example:

"1234567890123456".formatCreditCard(separator = "-") // 1234-5678-9012-3456
"1234567890123456".formatCreditCard() // 1234 5678 9012 3456

Since

1.1.0

Return

formatted credit card number.

-
public final static String format(Number $self, String pattern)

Format numbers with given pattern.

+
public final static String format(Number $self)
public final static String format(Number $self, String pattern)

Format numbers with given pattern.

@@ -87,7 +87,7 @@

Functions

-
public final static String formatCreditCard(    String $self,     String separator,     Integer separatorDigit)

Format string as credit card number.

+
public final static String formatCreditCard(String $self)
public final static String formatCreditCard(String $self, String separator)
public final static String formatCreditCard(    String $self,     String separator,     Integer separatorDigit)

Format string as credit card number.

diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-utils/compact-format.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-utils/compact-format.html new file mode 100644 index 00000000..45fd0a4c --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-utils/compact-format.html @@ -0,0 +1,54 @@ + + + + + compactFormat + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

compactFormat

+
+
public final static String compactFormat(Number $self)

Compact format numbers.

Example:

1200.compactFormat() // 1.2k

Since

1.1.0

Return

compact format number.

See also

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-utils/format-credit-card.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-utils/format-credit-card.html new file mode 100644 index 00000000..25065ebf --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-utils/format-credit-card.html @@ -0,0 +1,54 @@ + + + + + formatCreditCard + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

formatCreditCard

+
+
public final static String formatCreditCard(    String $self,     String separator,     Integer separatorDigit)
public final static String formatCreditCard(String $self, String separator)
public final static String formatCreditCard(String $self)

Format string as credit card number.

Example:

"1234567890123456".formatCreditCard(separator = "-") // 1234-5678-9012-3456
"1234567890123456".formatCreditCard() // 1234 5678 9012 3456

Since

1.1.0

Return

formatted credit card number.

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-utils/format.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-utils/format.html new file mode 100644 index 00000000..d9fbec24 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-utils/format.html @@ -0,0 +1,54 @@ + + + + + format + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

format

+
+
public final static String format(Number $self, String pattern)
public final static String format(Number $self)

Format numbers with given pattern.

Example:

123456789.format() // 1,234,567,890

Since

1.1.0

Return

format number.

See also

Parameters

pattern

default pattern is comma separator.

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-utils/index.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-utils/index.html new file mode 100644 index 00000000..137d43d2 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-utils/index.html @@ -0,0 +1,121 @@ + + + + + FormatterUtils + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

FormatterUtils

+
public final class FormatterUtils
+
+
+
+
+

Functions

+
+
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static String compactFormat(Number $self)

Compact format numbers.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static String format(Number $self)
public final static String format(Number $self, String pattern)

Format numbers with given pattern.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static String formatCreditCard(String $self)
public final static String formatCreditCard(String $self, String separator)
public final static String formatCreditCard(    String $self,     String separator,     Integer separatorDigit)

Format string as credit card number.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static String removeDecimalPart(Double $self)

Remove decimal part when Double number has decimal part.

public final static String removeDecimalPart(Float $self)

Remove decimal part when Float number has decimal part.

+
+
+
+
+
+
+
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-utils/remove-decimal-part.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-utils/remove-decimal-part.html new file mode 100644 index 00000000..acc9a514 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-formatter-utils/remove-decimal-part.html @@ -0,0 +1,54 @@ + + + + + removeDecimalPart + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

removeDecimalPart

+
+
public final static String removeDecimalPart(Float $self)

Remove decimal part when Float number has decimal part.

Example:

1.56F.removeDecimalPart() // 1.56
1.0F.removeDecimalPart() // 1

Since

1.1.0

See also


public final static String removeDecimalPart(Double $self)

Remove decimal part when Double number has decimal part.

Example:

1.56.removeDecimalPart() // 1.56
1.0.removeDecimalPart() // 1

Since

1.1.0

See also

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-number-converter/index.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-number-converter/index.html index 19175d30..a30bd67c 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-number-converter/index.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-number-converter/index.html @@ -57,7 +57,7 @@

Functions

-
public final String toArabic(String value)
+
public final static String toArabic(String value)
@@ -72,7 +72,7 @@

Functions

-
public final String toFarsi(String value)
+
public final static String toFarsi(String value)
@@ -87,7 +87,7 @@

Functions

-
public final String toMongolian(String value)
+
public final static String toMongolian(String value)
@@ -102,7 +102,7 @@

Functions

-
public final String toMyanmar(String value)
+
public final static String toMyanmar(String value)
@@ -117,7 +117,7 @@

Functions

-
public final String toTamil(String value)
+
public final static String toTamil(String value)
@@ -132,7 +132,7 @@

Functions

-
public final String toThai(String value)
+
public final static String toThai(String value)
@@ -147,7 +147,7 @@

Functions

-
public final String toUrdu(String value)
+
public final static String toUrdu(String value)
diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-number-converter/to-arabic.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-number-converter/to-arabic.html index 69cae98f..76873ffa 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-number-converter/to-arabic.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-number-converter/to-arabic.html @@ -42,7 +42,7 @@

toArabic

-
public final String toArabic(String value)

Since

1.1.0

+
public final static String toArabic(String value)

Since

1.1.0

+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final String lastPathComponent()
@@ -477,7 +387,7 @@

Functions

-
public final static String rotateLeft(String $self, Integer n)

Rotates the String to the left by specified distance.

+
public final static String rotateLeft(String $self)
public final static String rotateLeft(String $self, Integer n)

Rotates the String to the left by specified distance.

@@ -492,7 +402,7 @@

Functions

-
public final static String rotateRight(String $self, Integer n)

Rotates the String to the right by specified distance.

+
public final static String rotateRight(String $self)
public final static String rotateRight(String $self, Integer n)

Rotates the String to the right by specified distance.

diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-strings-kt/join-with.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-strings-kt/join-with.html index 450844bc..0fbeaef8 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-strings-kt/join-with.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.text/-strings-kt/join-with.html @@ -42,7 +42,7 @@

joinWith

-
public final static String joinWith<T extends Any>(    T params,     CharSequence separator,     CharSequence prefix,     CharSequence postfix,     Integer limit,     CharSequence truncated,     Function1<T, CharSequence> transform)

Creates a string from all the elements separated using separator and using the given prefix and postfix if supplied.

If the collection could be huge, you can specify a non-negative value of limit, in which case only the first limit elements will be appended, followed by the truncated string (which defaults to "...").

Example:

joinWith("H", "e", "l", "l", "o", separator = "") // Hello
joinWith(1, 2, 3, 4, separator = ", ") // 1, 2, 3, 4

Since

1.1.0

See also

+
public final static String joinWith<T extends Any>(    T params,     CharSequence separator,     CharSequence prefix,     CharSequence postfix,     Integer limit,     CharSequence truncated,     Function1<T, CharSequence> transform)
public final static String joinWith<T extends Any>(    T params,     CharSequence separator,     CharSequence prefix,     CharSequence postfix,     Integer limit,     CharSequence truncated)
public final static String joinWith<T extends Any>(    T params,     CharSequence separator,     CharSequence prefix,     CharSequence postfix,     Integer limit)
public final static String joinWith<T extends Any>(    T params,     CharSequence separator,     CharSequence prefix,     CharSequence postfix)
public final static String joinWith<T extends Any>(    T params,     CharSequence separator,     CharSequence prefix)
public final static String joinWith<T extends Any>(T params, CharSequence separator)
public final static String joinWith<T extends Any>(T params)

Creates a string from all the elements separated using separator and using the given prefix and postfix if supplied.

If the collection could be huge, you can specify a non-negative value of limit, in which case only the first limit elements will be appended, followed by the truncated string (which defaults to "...").

Example:

joinWith("H", "e", "l", "l", "o", separator = "") // Hello
joinWith(1, 2, 3, 4, separator = ", ") // 1, 2, 3, 4

Since

1.1.0

See also

-
+
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
public final Duration getMonths()
public final Duration getMonths()
public final Duration getMonths()
-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final Duration getWeeks()
public final Duration getWeeks()
public final Duration getWeeks()
-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final Duration getYears()
public final Duration getYears()
public final Duration getYears()
-
-
-
-
-

Properties

diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.time/-now-kt/index.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.time/-now-kt/index.html index 4316c9ea..70608b3c 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.time/-now-kt/index.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.time/-now-kt/index.html @@ -47,22 +47,7 @@

NowKt

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Instant now()

Get current time in Instant.

-
-
-
-
- +
@@ -92,51 +77,6 @@

Functions

- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDate nowInLocalDate(TimeZone timeZone)

Get current LocalDate.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalDateTime nowInLocalDateTime(TimeZone timeZone)

Get current LocalDateTime.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static LocalTime nowInLocalTime(TimeZone timeZone)

Get current LocalTime.

-
-
-
-
diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.time/-time-ago-kt/index.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.time/-time-ago-kt/index.html index 465d9076..41971878 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.time/-time-ago-kt/index.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.time/-time-ago-kt/index.html @@ -44,26 +44,8 @@

TimeAgoKt
public final class TimeAgoKt

-
-
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static String timeAgo(    Calendar $self,     String locale,     Calendar clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled,     Boolean allowFromNow)
public final static String timeAgo(    Date $self,     String locale,     Date clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled,     Boolean allowFromNow)
public final static String timeAgo(    Long $self,     String locale,     Long clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled,     Boolean allowFromNow)
public final static String timeAgo(    Instant $self,     String locale,     Instant clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled,     Boolean allowFromNow)
public final static String timeAgo(    LocalDateTime $self,     String locale,     LocalDateTime clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled,     Boolean allowFromNow)

Formats provided this value to a fuzzy time like 'a moment ago'.

-
-
-
-
-
-
+
+
-
public final String format(    Calendar date,     String locale,     Calendar clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled,     Boolean allowFromNow)
public final String format(    Date date,     String locale,     Date clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled,     Boolean allowFromNow)
public final String format(    Long date,     String locale,     Long clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled,     Boolean allowFromNow)
public final String format(    Instant date,     String locale,     Instant clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled,     Boolean allowFromNow)
public final String format(    LocalDateTime date,     String locale,     LocalDateTime clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled,     Boolean allowFromNow)

Formats provided date to a fuzzy time like 'a moment ago'.

+
public final static String format(Calendar date)
public final static String format(Date date)
public final static String format(Long date)
public final static String format(Instant date)
public final static String format(LocalDateTime date)
public final static String format(Calendar date, String locale)
public final static String format(Date date, String locale)
public final static String format(Long date, String locale)
public final static String format(Instant date, String locale)
public final static String format(LocalDateTime date, String locale)
public final static String format(    Calendar date,     String locale,     Calendar clock)
public final static String format(    Date date,     String locale,     Date clock)
public final static String format(    Long date,     String locale,     Long clock)
public final static String format(    Instant date,     String locale,     Instant clock)
public final static String format(    LocalDateTime date,     String locale,     LocalDateTime clock)
public final static String format(    Calendar date,     String locale,     Calendar clock,     DateLimitation minCutOff)
public final static String format(    Date date,     String locale,     Date clock,     DateLimitation minCutOff)
public final static String format(    Long date,     String locale,     Long clock,     DateLimitation minCutOff)
public final static String format(    Instant date,     String locale,     Instant clock,     DateLimitation minCutOff)
public final static String format(    LocalDateTime date,     String locale,     LocalDateTime clock,     DateLimitation minCutOff)
public final static String format(    Calendar date,     String locale,     Calendar clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled)
public final static String format(    Date date,     String locale,     Date clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled)
public final static String format(    Long date,     String locale,     Long clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled)
public final static String format(    Instant date,     String locale,     Instant clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled)
public final static String format(    LocalDateTime date,     String locale,     LocalDateTime clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled)
public final static String format(    Calendar date,     String locale,     Calendar clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled,     Boolean allowFromNow)
public final static String format(    Date date,     String locale,     Date clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled,     Boolean allowFromNow)
public final static String format(    Long date,     String locale,     Long clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled,     Boolean allowFromNow)
public final static String format(    Instant date,     String locale,     Instant clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled,     Boolean allowFromNow)
public final static String format(    LocalDateTime date,     String locale,     LocalDateTime clock,     DateLimitation minCutOff,     Boolean isWeekFormatEnabled,     Boolean allowFromNow)

Formats provided date to a fuzzy time like 'a moment ago'.

@@ -98,21 +98,6 @@

Functions

- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final Boolean isLocaleNumberEnabled()
-
-
-
-
@@ -123,7 +108,7 @@

Functions

-
public final Unit setDefaultLocale(String locale)

Sets the default locale. By default, it is en.

+
public final static Unit setDefaultLocale(String locale)

Sets the default locale. By default, it is en.

@@ -138,7 +123,7 @@

Functions

-
public final Unit setLocaleMessages(String locales)

Sets locales with the auto provided LookupMessages to be available when using the format function.

public final Unit setLocaleMessages(String locale)

Sets a locale with the auto provided LookupMessages to be available when using the format function.

public final Unit setLocaleMessages(String locale, LookupMessages lookupMessages)

Sets a locale with the provided lookupMessages to be available when using the format function.

+
public final static Unit setLocaleMessages(String locales)

Sets locales with the auto provided LookupMessages to be available when using the format function.

public final static Unit setLocaleMessages(String locale)

Sets a locale with the auto provided LookupMessages to be available when using the format function.

public final static Unit setLocaleMessages(String locale, LookupMessages lookupMessages)

Sets a locale with the provided lookupMessages to be available when using the format function.

@@ -153,22 +138,7 @@

Functions

-
public final Unit setLocaleMessagesAndDefaultLocale(String locale)
public final Unit setLocaleMessagesAndDefaultLocale(String locale, LookupMessages lookupMessages)

Sets a locale with the auto provided LookupMessages to be available when using the format function. also Sets the default locale.

-
-
- - - -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final Unit setLocaleNumberEnabled(Boolean isLocaleNumberEnabled)
+
public final static Unit setLocaleMessagesAndDefaultLocale(String locale)
public final static Unit setLocaleMessagesAndDefaultLocale(String locale, LookupMessages lookupMessages)

Sets a locale with the auto provided LookupMessages to be available when using the format function. also Sets the default locale.

@@ -209,13 +179,13 @@

Properties

- +
Link copied to clipboard
-
private Boolean isLocaleNumberEnabled
+
public Boolean isLocaleNumberEnabled
diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.time/-time-ago/set-default-locale.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.time/-time-ago/set-default-locale.html index 476ac6e2..b2ad5d88 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.time/-time-ago/set-default-locale.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx.time/-time-ago/set-default-locale.html @@ -42,7 +42,7 @@

setDefaultLocale

-
public final Unit setDefaultLocale(String locale)

Sets the default locale. By default, it is en.

Note: This function uses ISO 639-1 language code to identify the language. For more information see ISO 639-1.

Example:

setDefaultLocale("fa")

Since

1.1.0

See also

Throws

if the locale is not supported.

+
public final static Unit setDefaultLocale(String locale)

Sets the default locale. By default, it is en.

Note: This function uses ISO 639-1 language code to identify the language. For more information see ISO 639-1.

Example:

setDefaultLocale("fa")

Since

1.1.0

See also

Throws

if the locale is not supported.

-
-
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Number orZero(Number $self)

Return zero when number is null.

-
-
-
-
-
-
+
+
-
+
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
public final Boolean getIsNegative()
public final Boolean getIsNegative()
public final Boolean getIsNegative()
public final Boolean getIsNegative()
-
-
-
-
- +

Properties

+
- - + +
Link copied to clipboard
-
public final static Double orZero(Double $self)
public final static Float orZero(Float $self)
public final static Integer orZero(Integer $self)
public final static Long orZero(Long $self)

Return zero when number is null.

+
private final static Boolean isNegative

Checking negativity.

private final static Boolean isNegative

Checking negativity.

private final static Boolean isNegative

Checking negativity.

private final static Boolean isNegative

Checking negativity.

-
-

Properties

-
+
- - + +
Link copied to clipboard
-
private final static Boolean isNegative

Checking negativity.

private final static Boolean isNegative

Checking negativity.

private final static Boolean isNegative

Checking negativity.

private final static Boolean isNegative

Checking negativity.

+
private final static Boolean isPositive

Checking positivity.

private final static Boolean isPositive

Checking positivity.

private final static Boolean isPositive

Checking positivity.

private final static Boolean isPositive

Checking positivity.

diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-scope-kt/index.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-scope-kt/index.html index dd8dce7b..5b6eef1c 100644 --- a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-scope-kt/index.html +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-scope-kt/index.html @@ -44,41 +44,8 @@

ScopeKt

public final class ScopeKt
-
-
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
@Deprecated(message = "This function is deprecated and will be removed in next major release.Use runBlock() instead.", replaceWith = @ReplaceWith(imports = {"com.parsuomash.affogato.core.ktx.runBlock"}, expression = "runBlock(block)"), level = DeprecationLevel.WARNING)
public final static T block<T extends Any>(T $self, Function0<Unit> block)

Return the value before run the execution block.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static T runBlock<T extends Any>(T $self, Function0<Unit> block)

Return the value before run the execution block.

-
-
-
-
-
-
+
+
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static R ifNotNull<T extends Any, R extends Any>(T $self, Function1<T, R> block)

ifNotNull execute when value isn't null.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Object ifNull<T extends Any>(T $self, Function1<T, Object> block)

ifNull execute when value is null.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Boolean isNotNull<T extends Any>(T $self)

Checking none nullability.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Boolean isNull<T extends Any>(T $self)

Checking nullability.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static T orDefault<T extends Any>(T $self, T default)

when variable is null default value maintained.

-
-
-
-
diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/counter.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/counter.html new file mode 100644 index 00000000..104fa8c5 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/counter.html @@ -0,0 +1,54 @@ + + + + + counter + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

counter

+
+
public final static Map<Character, Integer> counter(String content)

Calculate count of each value by group in the string.

Example:

val value = "aba"
counter(value) // { a = 2, b = 1 }

Since

1.1.0

See also


public final static Map<T, Integer> counter<T extends Any>(Array<T> content)

Calculate count of each value by group in the Array.

Example:

val value = arrayOf("a", "b", "a")
counter(value) // { a = 2, b = 1 }

Since

1.1.0

See also


public final static Map<Byte, Integer> counter(ByteArray content)

Calculate count of each value by group in the byte array.

Example:

val value = byteArrayOf(1, 2, 1)
counter(value) // { 1 = 2, 2 = 1 }

Since

1.1.0

See also


public final static Map<Character, Integer> counter(CharArray content)

Calculate count of each value by group in the char array.

Example:

val value = charArrayOf('a', 'b', 'a')
counter(value) // { a = 2, b = 1 }

Since

1.1.0

See also


public final static Map<Short, Integer> counter(ShortArray content)

Calculate count of each value by group in the short array.

Example:

val value = shortArrayOf(1, 2, 1)
counter(value) // { 1 = 2, 2 = 1 }

Since

1.1.0

See also


public final static Map<Integer, Integer> counter(IntArray content)

Calculate count of each value by group in the int array.

Example:

val value = intArrayOf(1, 2, 1)
counter(value) // { a = 2, b = 1 }

Since

1.1.0

See also


public final static Map<Long, Integer> counter(LongArray content)

Calculate count of each value by group in the long array.

Example:

val value = longArrayOf(1L, 2L, 1L)
counter(value) // { 1L = 2, 2L = 1 }

Since

1.1.0

See also


public final static Map<Float, Integer> counter(FloatArray content)

Calculate count of each value by group in the float array.

Example:

val value = floatArrayOf(1F, 2F, 1F)
counter(value) // { 1F = 2, 2F = 1 }

Since

1.1.0

See also


public final static Map<Double, Integer> counter(DoubleArray content)

Calculate count of each value by group in the double array.

Example:

val value = doubleArrayOf(1.0, 2.0, 1.0)
counter(value) // { 1.0 = 2, 2.0 = 1 }

Since

1.1.0

See also


public final static Map<Boolean, Integer> counter(BooleanArray content)

Calculate count of each value by group in the boolean array.

Example:

val value = booleanArrayOf(false, true, false)
counter(value) // { false 2, true = 1 }

Since

1.1.0

See also


public final static Map<T, Integer> counter<T extends Any>(Iterable<T> content)

Calculate count of each value by group in the iterable.

Example:

val value = listOf("a", "b", "a")
counter(value) // { a = 2, b = 1 }

Since

1.1.0

See also

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/index.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/index.html new file mode 100644 index 00000000..3ac143ce --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/index.html @@ -0,0 +1,151 @@ + + + + + StandardUtils + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

StandardUtils

+
public final class StandardUtils
+
+
+
+
+

Functions

+
+
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static Map<T, Integer> counter<T extends Any>(Array<T> content)

Calculate count of each value by group in the Array.

public final static Map<Boolean, Integer> counter(BooleanArray content)

Calculate count of each value by group in the boolean array.

public final static Map<Byte, Integer> counter(ByteArray content)

Calculate count of each value by group in the byte array.

public final static Map<Character, Integer> counter(CharArray content)

Calculate count of each value by group in the char array.

public final static Map<Double, Integer> counter(DoubleArray content)

Calculate count of each value by group in the double array.

public final static Map<Float, Integer> counter(FloatArray content)

Calculate count of each value by group in the float array.

public final static Map<Integer, Integer> counter(IntArray content)

Calculate count of each value by group in the int array.

public final static Map<Long, Integer> counter(LongArray content)

Calculate count of each value by group in the long array.

public final static Map<Short, Integer> counter(ShortArray content)

Calculate count of each value by group in the short array.

public final static Map<Character, Integer> counter(String content)

Calculate count of each value by group in the string.

public final static Map<T, Integer> counter<T extends Any>(Iterable<T> content)

Calculate count of each value by group in the iterable.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static Boolean tryCatchBool(Function0<Boolean> block)

tryCatchBool used when you want to return a boolean value or return false if an exception is thrown.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static Boolean tryCatchBoolean(Function0<Unit> block)

tryCatchBoolean used when you want to return false if an exception is thrown.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static T tryCatchElse<T extends Any>(Function0<T> elseBlock, Function0<T> block)

tryCatchElse used when you want to return a default value if an exception is thrown.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static Unit tryCatchIgnore(Function0<Unit> block)

tryCatchIgnore used when you want to ignore catch block if an exception is thrown.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
public final static T tryCatchNull<T extends Any>(Function0<T> block)

tryCatchNull used when you want to return null if an exception is thrown.

+
+
+
+
+
+
+
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/try-catch-bool.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/try-catch-bool.html new file mode 100644 index 00000000..d18945ed --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/try-catch-bool.html @@ -0,0 +1,54 @@ + + + + + tryCatchBool + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

tryCatchBool

+
+
public final static Boolean tryCatchBool(Function0<Boolean> block)

tryCatchBool used when you want to return a boolean value or return false if an exception is thrown.

Example:

tryCatchBoolean {
...
throw Exception("throw")
} // false

tryCatchBoolean {
val result = false
if(...) {
result = true
}
result
}

Since

1.2.0

See also

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/try-catch-boolean.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/try-catch-boolean.html new file mode 100644 index 00000000..483bc046 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/try-catch-boolean.html @@ -0,0 +1,54 @@ + + + + + tryCatchBoolean + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

tryCatchBoolean

+
+
public final static Boolean tryCatchBoolean(Function0<Unit> block)

tryCatchBoolean used when you want to return false if an exception is thrown.

Example:

tryCatchBoolean {
...
throw Exception("throw")
} // false

tryCatchBoolean {
...
} // true

Since

1.1.0

See also

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/try-catch-else.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/try-catch-else.html new file mode 100644 index 00000000..d0491cce --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/try-catch-else.html @@ -0,0 +1,54 @@ + + + + + tryCatchElse + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

tryCatchElse

+
+
public final static T tryCatchElse<T extends Any>(Function0<T> elseBlock, Function0<T> block)

tryCatchElse used when you want to return a default value if an exception is thrown.

Example:

var num = 0
tryCatchElse(elseBlock = { --num }) {
throw Exception("throw")
num++
} // -1

tryCatchElse(elseBlock = { --num }) {
++num
} // 0

Since

1.1.0

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/try-catch-ignore.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/try-catch-ignore.html new file mode 100644 index 00000000..52cc089b --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/try-catch-ignore.html @@ -0,0 +1,54 @@ + + + + + tryCatchIgnore + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

tryCatchIgnore

+
+
public final static Unit tryCatchIgnore(Function0<Unit> block)

tryCatchIgnore used when you want to ignore catch block if an exception is thrown.

Example:

tryCatchIgnore {
...
throw Exception("throw")
}

Since

1.1.0

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/try-catch-null.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/try-catch-null.html new file mode 100644 index 00000000..3de07e17 --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/-standard-utils/try-catch-null.html @@ -0,0 +1,54 @@ + + + + + tryCatchNull + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

tryCatchNull

+
+
public final static T tryCatchNull<T extends Any>(Function0<T> block)

tryCatchNull used when you want to return null if an exception is thrown.

Example:

tryCatchNull {
throw Exception("throw")
num++
} // null

tryCatchNull {
var num = 0
++num
} // 1

Since

1.1.0

+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/_-number/index.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/_-number/index.html new file mode 100644 index 00000000..52c9375e --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/_-number/index.html @@ -0,0 +1,58 @@ + + + + + _Number + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

_Number

+
public final class _Number
+
+
+
+
+
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/_-primitives/index.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/_-primitives/index.html new file mode 100644 index 00000000..5bd2976d --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/_-primitives/index.html @@ -0,0 +1,91 @@ + + + + + _Primitives + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

_Primitives

+
public final class _Primitives
+
+
+
+
+

Properties

+
+
+
+
+ + +
Link copied to clipboard
+
+
+
+
private final static Boolean isNegative

Checking negativity.

private final static Boolean isNegative

Checking negativity.

private final static Boolean isNegative

Checking negativity.

private final static Boolean isNegative

Checking negativity.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
private final static Boolean isPositive

Checking positivity.

private final static Boolean isPositive

Checking positivity.

private final static Boolean isPositive

Checking positivity.

private final static Boolean isPositive

Checking positivity.

+
+
+
+
+
+
+
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/_-scope/index.html b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/_-scope/index.html new file mode 100644 index 00000000..de8be7be --- /dev/null +++ b/docs/affogato-core-ktx/com.parsuomash.affogato.core.ktx/_-scope/index.html @@ -0,0 +1,58 @@ + + + + + _Scope + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

_Scope

+
public final class _Scope
+
+
+
+
+
+
+ +
+
+ + + diff --git a/docs/affogato-core-ktx/navigation.html b/docs/affogato-core-ktx/navigation.html index 0322d0a0..6e71e144 100644 --- a/docs/affogato-core-ktx/navigation.html +++ b/docs/affogato-core-ktx/navigation.html @@ -367,9 +367,9 @@ -
+
diff --git a/docs/affogato-coroutines-core/com.parsuomash.affogato.coroutines.core/-standard-kt/index.html b/docs/affogato-coroutines-core/com.parsuomash.affogato.coroutines.core/-standard-kt/index.html index 4fef135e..10e668b8 100644 --- a/docs/affogato-coroutines-core/com.parsuomash.affogato.coroutines.core/-standard-kt/index.html +++ b/docs/affogato-coroutines-core/com.parsuomash.affogato.coroutines.core/-standard-kt/index.html @@ -44,86 +44,8 @@

StandardKt

public final class StandardKt
-
-
-

Functions

-
-
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Boolean suspendedTryCatchBool(CoroutineContext context, SuspendFunction0<Boolean> block)

suspendedTryCatchBool used when you want to return a boolean value or return false if an exception is thrown in suspend functions.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Boolean suspendedTryCatchBoolean(CoroutineContext context, SuspendFunction0<Unit> block)

suspendedTryCatchBoolean used when you want to return false if an exception is thrown in suspend functions.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static T suspendedTryCatchElse<T extends Any>(    CoroutineContext context,     SuspendFunction0<T> elseBlock,     SuspendFunction0<T> block)

suspendedTryCatchElse used when you want to return a default value if an exception is thrown in suspend functions.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static Unit suspendedTryCatchIgnore<T extends Any>(CoroutineContext context, SuspendFunction0<T> block)

suspendedTryCatchIgnore used when you want to ignore catch block if an exception is thrown in suspend functions.

-
-
-
-
- -
-
-
- - -
Link copied to clipboard
-
-
-
-
public final static T suspendedTryCatchNull<T extends Any>(CoroutineContext context, SuspendFunction0<T> block)

suspendedTryCatchNull used when you want to return null if an exception is thrown in suspend functions.

-
-
-
-
-
-
+
+
-
private String tag

Logging tag help for beter filter and search.

+
public String tag

Logging tag help for beter filter and search.

diff --git a/docs/affogato-logger-android/com.parsuomash.affogato.logger.android/-logger/info.html b/docs/affogato-logger-android/com.parsuomash.affogato.logger.android/-logger/info.html index c7e40d41..1942ceb6 100644 --- a/docs/affogato-logger-android/com.parsuomash.affogato.logger.android/-logger/info.html +++ b/docs/affogato-logger-android/com.parsuomash.affogato.logger.android/-logger/info.html @@ -42,7 +42,7 @@

info

-
public final Unit info(    String tag,     String message,     Throwable throwable)

Send a INFO log message and log the exception.

Since

1.5.0

Parameters

message

String: The message you would like logged. This value cannot be null.

throwable

Throwable: An exception to log This value may be null.

tag

String: Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs. This value may be null.

+
public final static Unit info(    String tag,     String message,     Throwable throwable)

Send a INFO log message and log the exception.

Since

1.5.0

Parameters

message

String: The message you would like logged. This value cannot be null.

throwable

Throwable: An exception to log This value may be null.

tag

String: Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs. This value may be null.