doc / ch.tutteli.atrium.core.polyfills

Package ch.tutteli.atrium.core.polyfills

Contains polyfills for functionality which is missing on certain platforms so that they can be used in a common way.

Extensions for External Classes

java.lang.StringBuilder

kotlin.reflect.KClass

kotlin.String

kotlin.Throwable

Functions

formatFloatingPointNumber

expect fun formatFloatingPointNumber(number: Number): String

Formats the given number in a floating point format.

getAtriumProperty

expect fun getAtriumProperty(key: String): String?

Returns the specified value for the property with the given key or null in case it is not defined.

loadServices

expect fun <T : Any> loadServices(kClass: KClass<T>): Sequence<T>

Loads all available service for the given kClass.

loadSingleService

expect fun <T : Any> loadSingleService(kClass: KClass<T>): T

Loads the service for the given kClass and throws an IllegalStateException if it finds more than one.

setAtriumProperty

expect fun setAtriumProperty(key: String, newValue: String): Unit

Sets the property with the given key to the given newValue.

useSingleService

fun <T : Any> useSingleService(kClass: KClass<T>, itr: Iterator<T>): T

Returns the single service contained in itr and throws if there is any ore more than one.