Package-level declarations

Types

Link copied to clipboard
abstract class BaseLocale

An object representing a specific geographical, political, or cultural region.

Link copied to clipboard
abstract class BaseTimeZone

A TimeZone represents a time zone. Accounts for Daylight Savings

Link copied to clipboard
external class BigDecimal(a: Any, b: Any)
Link copied to clipboard
interface BufferedAsListChannel<T : Any> : SendChannel<T> , ReceiveChannel<List<T>>

A Rendezvous Channel that buffers all elements sent to it in a list until the next receive

Link copied to clipboard
object ByteUtils
Link copied to clipboard
typealias Date = KalugaDate
Link copied to clipboard
sealed class Decimal : Comparable<Decimal>

Immutable, arbitrary-precision signed decimal numbers.

Link copied to clipboard

Default implementation of KalugaDate

Default implementation of KalugaDate

actual class DefaultKalugaDate

Default implementation of KalugaDate

Default implementation of KalugaDate

Default implementation of KalugaDate

Link copied to clipboard
typealias EmptyCompletableDeferred = CompletableDeferred<Unit>
Link copied to clipboard
actual typealias FiniteDecimal = BigDecimal

Platform specific representation of a finite immutable, arbitrary-precision signed decimal number

Platform specific representation of a finite immutable, arbitrary-precision signed decimal number

actual data class FiniteDecimal : Comparable<FiniteDecimal>

Platform specific representation of a finite immutable, arbitrary-precision signed decimal number

actual data class FiniteDecimal : Comparable<FiniteDecimal>

Platform specific representation of a finite immutable, arbitrary-precision signed decimal number

actual typealias FiniteDecimal = BigDecimal

Platform specific representation of a finite immutable, arbitrary-precision signed decimal number

Link copied to clipboard
abstract class KalugaDate : Comparable<KalugaDate>

Class describing a point in time Dates are localized according to a KalugaLocale and relative to a given KalugaTimeZone

Link copied to clipboard
actual typealias KalugaDateHolder = Date
expect class KalugaDateHolder

Class holding the platform value of the desired Date.

actual typealias KalugaDateHolder = <Error class: unknown class>
actual typealias KalugaDateHolder = Date
actual typealias KalugaDateHolder = Date
Link copied to clipboard
actual data class KalugaLocale : BaseLocale

Default implementation of BaseLocale

expect class KalugaLocale : BaseLocale

Default implementation of BaseLocale

actual data class KalugaLocale

Default implementation of BaseLocale

actual data class KalugaLocale : BaseLocale

Default implementation of BaseLocale

actual data class KalugaLocale : BaseLocale

Default implementation of BaseLocale

Link copied to clipboard

A default implementation of BaseTimeZone.

A default implementation of BaseTimeZone.

actual class KalugaTimeZone

A default implementation of BaseTimeZone.

A default implementation of BaseTimeZone.

A default implementation of BaseTimeZone.

Link copied to clipboard
typealias Locale = KalugaLocale
Link copied to clipboard
data class Rounding(val maximumFractionDigits: Int? = null, val roundingMode: String = ROUNDING_MODE, val maximumSignificantDigits: Int = DECIMAL_128_SIGNIFICANT_DIGITS)

Rounding for BigDecimal

Link copied to clipboard
sealed class RoundingMode

Rounding Mode for rounding a Decimal

Link copied to clipboard
expect interface Serializable

Interface that indicates that the implementing object can be serialized using platform specific serialization.

actual interface Serializable

NOT SUPPORTED ON iOS

actual interface Serializable

Not supported on JavaScript

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The unit system used by a country. For more advanced functionality please use Kaluga Scientific

Properties

Link copied to clipboard

Locale for English/US in a POSIX format. Useful shortcut when dealing with fixed locale formats.

Link copied to clipboard

True if this KalugaDate is last month

Link copied to clipboard

True if this KalugaDate is last year

Link copied to clipboard

True if this KalugaDate is next month

Link copied to clipboard

True if this KalugaDate is next year

Link copied to clipboard

True if this KalugaDate is this month

Link copied to clipboard

True if this KalugaDate is this year

Link copied to clipboard

True if this KalugaDate is today

Link copied to clipboard

True if this KalugaDate is tomorrow

Link copied to clipboard

True if this KalugaDate is yesterday

Link copied to clipboard
val IntRange.nsRange: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val <Error class: unknown class><<Error class: unknown class>>.range: IntRange
Link copied to clipboard

Indicates whether this locale use a 24 hour clock cycle.

Link copied to clipboard

Functions

Link copied to clipboard
inline fun <T> T.applyIf(condition: Boolean, block: T.() -> Unit): T

Applies a given code block if a given condition is met

Link copied to clipboard
fun <T : Any> BufferedAsListChannel(coroutineContext: CoroutineContext, dispatcher: CloseableCoroutineDispatcher, closeDispatcherOnCompletion: Boolean): BufferedAsListChannel<T>

Creates a BufferedAsListChannel that batches its elements with a given CoroutineContext

Link copied to clipboard
inline fun <T : Enum<T>> Enum.Companion.byOrdinalOrDefault(ordinal: Int, defaultValue: T): T

Returns the enum by matching ordinals position, or the given default value if no ordinals match.

Link copied to clipboard
fun bytesOf(vararg bytes: Int): ByteArray

Returns ByteArray for given bytes

Link copied to clipboard
Link copied to clipboard
fun <T> Iterable<T>.containsAny(elements: Iterable<T>): Boolean

Returns true if contains at least one element from elements

Link copied to clipboard

Converts a hex String to ByteArray

Link copied to clipboard
operator fun Decimal.div(value: Decimal): Decimal

Divides two Decimal.

fun Decimal.div(value: Decimal, scale: Int): Decimal
fun Decimal.div(value: Decimal, scale: Int, roundingMode: RoundingMode = RoundingMode.RoundHalfEven): Decimal

Divides two Decimal to a given precision.

Link copied to clipboard

Creates a CompletableDeferred in an active state of typed Unit. In other words, it returns no value (either it will complete or throw an Exception). It is optionally a child of a parent job.

Link copied to clipboard
fun DefaultKalugaDate.Companion.epoch(offsetInMilliseconds: Long, timeZone: KalugaTimeZone = KalugaTimeZone.current(), locale: KalugaLocale = defaultLocale): KalugaDate

Creates a KalugaDate relative to January 1st 1970 00:00:00 GMT

Link copied to clipboard
inline fun <R> Sequence<*>.firstInstance(): R?
inline suspend fun <R> Flow<*>.firstInstance(): R?

Returns first element that is instance of specific type parameter R, or null if not found

Link copied to clipboard
fun <T> Deferred<T>.getCompletedOrNull(): T?

Gets the Deferred.getCompleted value if Deferred.isCompleted or null otherwise.

Link copied to clipboard

Checks whether a KalugaDate is in the same year as a given Date.

Link copied to clipboard

Checks whether a KalugaDate is on the same day as a given Date.

Link copied to clipboard

Checks whether a KalugaDate is on the same month as a given Date.

Link copied to clipboard
fun Int.length(): Int

Determines the number of digits in an Integer

Link copied to clipboard
operator fun Decimal.minus(value: Decimal): Decimal

Subtracts two Decimal.

infix operator fun KalugaDate.minus(other: KalugaDate): Duration

Gets the Duration between two KalugaDate

infix operator fun KalugaDate.minus(duration: Duration): KalugaDate

Gets a KalugaDate that is duration before this date.

fun Decimal.minus(value: Decimal, scale: Int): Decimal
fun Decimal.minus(value: Decimal, scale: Int, roundingMode: RoundingMode = RoundingMode.RoundHalfEven): Decimal

Subtracts two Decimal to a given precision.

Link copied to clipboard
fun DefaultKalugaDate.Companion.now(offsetInMilliseconds: Long, timeZone: KalugaTimeZone = KalugaTimeZone.current(), locale: KalugaLocale = defaultLocale): KalugaDate

Creates a KalugaDate relative to the current time

Link copied to clipboard
fun DefaultKalugaDate.Companion.nowUtc(offsetInMilliseconds: Long, locale: KalugaLocale = defaultLocale): KalugaDate
fun DefaultKalugaDate.Companion.nowUtc(offset: Duration = 0.milliseconds, locale: KalugaLocale = defaultLocale): KalugaDate

Creates a KalugaDate relative to the current time, in the UTC timezone

Link copied to clipboard
operator fun Decimal.plus(value: Decimal): Decimal

Adds two Decimal together.

infix operator fun KalugaDate.plus(duration: Duration): KalugaDate

Gets a KalugaDate that is duration after this date.

fun Decimal.plus(value: Decimal, scale: Int): Decimal
fun Decimal.plus(value: Decimal, scale: Int, roundingMode: RoundingMode = RoundingMode.RoundHalfEven): Decimal

Adds two Decimal together scaled to a given precision.

Link copied to clipboard
infix fun Decimal.pow(n: Int): Decimal

Raises two Decimal.

fun Decimal.pow(n: Int, scale: Int): Decimal
fun Decimal.pow(n: Int, scale: Int, roundingMode: RoundingMode = RoundingMode.RoundHalfEven): Decimal

Raises two Decimal to a given precision.

Link copied to clipboard
fun Decimal.round(scale: Int, roundingMode: RoundingMode = RoundingMode.RoundHalfEven): Decimal

Rounds a Decimal to a scale.

Link copied to clipboard
operator fun Decimal.times(value: Decimal): Decimal

Multiplies two Decimal.

fun Decimal.times(value: Decimal, scale: Int): Decimal
fun Decimal.times(value: Decimal, scale: Int, roundingMode: RoundingMode = RoundingMode.RoundHalfEven): Decimal

Multiplies two Decimal to a given precision.

Link copied to clipboard
fun <Error class: unknown class>.toByteArray(): ByteArray

Converts a NSData to its corresponding ByteArray

Link copied to clipboard
fun DefaultKalugaDate.Companion.today(timeZone: KalugaTimeZone = KalugaTimeZone.current(), locale: KalugaLocale = defaultLocale): KalugaDate

Gets a KalugaDate that is set at midnight on the same day as the current time.

Link copied to clipboard

Converts a Number to a Decimal

Converts a String to a Decimal

Link copied to clipboard

Converts a ByteArray to a list of Decimal

Converts a DoubleArray to a list of Decimal

Converts a FloatArray to a list of Decimal

Converts an IntArray to a list of Decimal

Converts a LongArray to a list of Decimal

Converts a ShortArray to a list of Decimal

Converts a Collection of NumberType to a list of Decimal

Link copied to clipboard

Gets the double value of a Decimal

Link copied to clipboard

Converts a collection of Decimal to a DoubleArray

Link copied to clipboard

Gets a KalugaDate equal to 23:59:59:999 on the same day as this Date

Link copied to clipboard

Converts a ByteArray to a String representing the bytes as their hexadecimal value

Link copied to clipboard

Gets the integer value of a Decimal

Link copied to clipboard

Converts a collection of Decimal to an IntArray

Link copied to clipboard

Gets the long value of a Decimal

Link copied to clipboard

Converts a collection of Decimal to a LongArray

Link copied to clipboard
fun DefaultKalugaDate.Companion.tomorrow(timeZone: KalugaTimeZone = KalugaTimeZone.current(), locale: KalugaLocale = defaultLocale): KalugaDate

Gets a KalugaDate that is set at midnight on the day after the current time.

Link copied to clipboard
fun ByteArray.toNSData(): <Error class: unknown class>

Converts a ByteArray to its corresponding NSData

Link copied to clipboard

Gets a KalugaDate equal to midnight on the same day as this Date

Link copied to clipboard

Gets the string value of a Decimal

Link copied to clipboard

Converts a collection of Decimal to a list of String

Link copied to clipboard
inline fun <T : Any> List<*>.typedList(): List<T>

Converts a list of unknown typing to a list of a given type. This proves useful since generics are lost when converting ObjC/Swift to Kotlin

Link copied to clipboard
inline fun <K : Any, V : Any> Map<*, *>.typedMap(): Map<K, V>

Converts a map of unknown typing to a map of a given key-value type. This proves useful since generics are lost when converting ObjC/Swift to Kotlin