Package-level declarations

Properties

Link copied to clipboard

Returns a copy of this string having its first letter titlecased, or the original string if it's empty or already starts with a title case letter.

Link copied to clipboard

Returns a copy of this string having its first letter lowercased, or the original string if it's empty or already starts with a lower case letter.

Link copied to clipboard

Checks if the object is not null.

Link copied to clipboard
val <T> T?.isNull: Boolean

Checks if the object is null.

Functions

Link copied to clipboard
inline fun <T> Collection<T>?.orDefault(default: Collection<T>?): Collection<T>

Returns this collection if it is not null and not empty, or the specified default collection otherwise.

inline fun <K, V> Map<K, V>?.orDefault(default: Map<K, V>?): Map<K, V>

Returns this map if it is not null and not empty, or the specified default map otherwise.

Link copied to clipboard
inline fun <T : Number> T?.orZero(): Number

Returns this number if it's not null, or 0 otherwise.

Link copied to clipboard
inline fun <T : Number> T?.toCurrency(locale: Locale = Locale.getDefault()): String

Formats this number as currency and returns the result as a string.

Link copied to clipboard

Toggle the Boolean Value, if it's true then it will become false.

Link copied to clipboard

Converts Boolean to Int, if true then 1 else 0

Link copied to clipboard
inline fun <T : Number> T?.toPercent(locale: Locale = Locale.getDefault()): String

Formats this number as a percentage and returns the result as a string.