Package-level declarations

Types

Link copied to clipboard
sealed interface MutableProvider<T> : Provider<T>

A MutableProvider is a Provider that allows setting the value.

Link copied to clipboard
sealed interface Provider<out T> : Supplier<T>

A Provider is a thread-safe, lazily-evaluated, reactive data source that holds a single value of type T.

Properties

Link copied to clipboard

A Provider that always returns null.

Functions

Link copied to clipboard
fun <T> combinedProvider(providers: List<Provider<T>>): Provider<List<T>>

Creates and returns a new Provider that combines all values of providers.

fun <T, R> combinedProvider(providers: List<Provider<T>>, mapValue: (List<T>) -> R): Provider<R>

Creates and returns a new Provider that combines all values of providers and immediately maps them to R using mapValue.

Creates and returns a new Provider that combines the values of a and b.

fun <A, B, R> combinedProvider(a: Provider<A>, b: Provider<B>, mapValue: (A, B) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a and b and immediately maps them to R using mapValue.

fun <A, B, C> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>): Provider<Tuple3<A, B, C>>

Creates and returns a new Provider that combines the values of a, b and c.

fun <A, B, C, R> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, mapValue: (A, B, C) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b and c and immediately maps them to R using mapValue.

fun <A, B, C, D> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>): Provider<Tuple4<A, B, C, D>>

Creates and returns a new Provider that combines the values of a, b, c and d.

fun <A, B, C, D, R> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, mapValue: (A, B, C, D) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b, c and d and immediately maps them to R using mapValue.

fun <A, B, C, D, E> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>): Provider<Tuple5<A, B, C, D, E>>

Creates and returns a new Provider that combines the values of a, b, c, d and e.

fun <A, B, C, D, E, R> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, mapValue: (A, B, C, D, E) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b, c, d and e and immediately maps them to R using mapValue.

fun <A, B, C, D, E, F> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>): Provider<Tuple6<A, B, C, D, E, F>>

Creates and returns a new Provider that combines the values of a, b, c, d, e and f.

fun <A, B, C, D, E, F, R> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, mapValue: (A, B, C, D, E, F) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b, c, d, e and f and immediately maps them to R using mapValue.

fun <A, B, C, D, E, F, G> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>): Provider<Tuple7<A, B, C, D, E, F, G>>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f and g.

fun <A, B, C, D, E, F, G, R> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>, mapValue: (A, B, C, D, E, F, G) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f and g and immediately maps them to R using mapValue.

fun <A, B, C, D, E, F, G, H> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>, h: Provider<H>): Provider<Tuple8<A, B, C, D, E, F, G, H>>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f, g and h.

fun <A, B, C, D, E, F, G, H, R> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>, h: Provider<H>, mapValue: (A, B, C, D, E, F, G, H) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f, g and h and immediately maps them to R using mapValue.

fun <A, B, C, D, E, F, G, H, I> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>, h: Provider<H>, i: Provider<I>): Provider<Tuple9<A, B, C, D, E, F, G, H, I>>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f, g, h and i.

fun <A, B, C, D, E, F, G, H, I, R> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>, h: Provider<H>, i: Provider<I>, mapValue: (A, B, C, D, E, F, G, H, I) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f, g, h and i and immediately maps them to R using mapValue.

fun <A, B, C, D, E, F, G, H, I, J> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>, h: Provider<H>, i: Provider<I>, j: Provider<J>): Provider<Tuple10<A, B, C, D, E, F, G, H, I, J>>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f, g, h, i and j.

fun <A, B, C, D, E, F, G, H, I, J, R> combinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>, h: Provider<H>, i: Provider<I>, j: Provider<J>, mapValue: (A, B, C, D, E, F, G, H, I, J) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f, g, h, i and j and immediately maps them to R using mapValue.

Link copied to clipboard
inline fun <T, R> Provider<Collection<T>>.flatMapCollection(crossinline transform: (T) -> Iterable<R>): Provider<List<R>>

Creates and returns a new Provider that flat-maps the elements of the Collection obtained from this into a list using the transform function.

Link copied to clipboard
inline fun <T, R, C : MutableCollection<in R>> Provider<Collection<T>>.flatMapCollectionTo(crossinline makeCollection: (size: Int) -> C, crossinline transform: (T) -> Iterable<R>): Provider<C>

Creates and returns a new Provider that flat-maps the elements of the Collection obtained from this into a collection created by makeCollection using the transform function.

Link copied to clipboard

Creates and returns a new Provider that maps to the provider that is the value of this.

Link copied to clipboard

Creates and returns a new Provider that flattens the List of Lists obtained from this.

Link copied to clipboard
@JvmName(name = "arrayGet")
operator fun <T> Provider<Array<T>>.get(index: Int): Provider<T>
@JvmName(name = "arrayGet")
operator fun <T> Provider<Array<T>>.get(index: Provider<Int>): Provider<T>
@JvmName(name = "listGet")
operator fun <T> Provider<List<T>>.get(index: Int): Provider<T>
@JvmName(name = "listGet")
operator fun <T> Provider<List<T>>.get(index: Provider<Int>): Provider<T>

Creates and returns a new Provider that maps to the element at index or throws NoSuchElementException.

Link copied to clipboard
@JvmName(name = "arrayGetCoerced")
fun <T> Provider<Array<T>>.getCoerced(index: Int): Provider<T>
@JvmName(name = "arrayGetCoerced")
fun <T> Provider<Array<T>>.getCoerced(index: Provider<Int>): Provider<T>
@JvmName(name = "listGetCoerced")
fun <T> Provider<List<T>>.getCoerced(index: Int): Provider<T>
@JvmName(name = "listGetCoerced")
fun <T> Provider<List<T>>.getCoerced(index: Provider<Int>): Provider<T>

Creates and returns a new Provider that maps to the element at index or the element at the closest valid index.

Link copied to clipboard
@JvmName(name = "arrayGetMod")
fun <T> Provider<Array<T>>.getMod(index: Int): Provider<T>
@JvmName(name = "arrayGetMod")
fun <T> Provider<Array<T>>.getMod(index: Provider<Int>): Provider<T>

Creates and returns a new Provider that maps to the element at index modulo the array size.

@JvmName(name = "listGetMod")
fun <T> Provider<List<T>>.getMod(index: Int): Provider<T>
@JvmName(name = "listGetMod")
fun <T> Provider<List<T>>.getMod(index: Provider<Int>): Provider<T>

Creates and returns a new Provider that maps to the element at index modulo the list size.

Link copied to clipboard
@JvmName(name = "arrayGetOrNull")
fun <T> Provider<Array<T>>.getOrNull(index: Int): Provider<T?>
@JvmName(name = "arrayGetOrNull")
fun <T> Provider<Array<T>>.getOrNull(index: Provider<Int>): Provider<T?>
@JvmName(name = "listGetOrNull")
fun <T> Provider<List<T>>.getOrNull(index: Int): Provider<T?>
@JvmName(name = "listGetOrNull")
fun <T> Provider<List<T>>.getOrNull(index: Provider<Int>): Provider<T?>

Creates and returns a new Provider that maps to the element at index or null if the index is out of bounds.

Link copied to clipboard
inline fun <T, R> Provider<Collection<T>>.mapEach(crossinline transform: (T) -> R): Provider<List<R>>

Creates and returns a new Provider that maps each element of the Collection obtained from this using the transform function.

Link copied to clipboard
inline fun <T, R : Any> Provider<Collection<T>>.mapEachNotNull(crossinline transform: (T) -> R?): Provider<List<R>>

Creates and returns a new Provider that maps each element of the Collection obtained from this using the transform function and filters out all null results.

Link copied to clipboard
inline fun <T, R : Any, C : MutableCollection<in R>> Provider<Collection<T>>.mapEachNotNullTo(crossinline makeCollection: (size: Int) -> C, crossinline transform: (T) -> R?): Provider<C>

Creates and returns a new Provider that maps each element of the Collection obtained from this using the transform function and filters out all null results. The results are added to a collection created by makeCollection.

Link copied to clipboard
inline fun <T, R, C : MutableCollection<in R>> Provider<Collection<T>>.mapEachTo(crossinline makeCollection: (size: Int) -> C, crossinline transform: (T) -> R): Provider<C>

Creates and returns a new Provider that maps each element of the Collection obtained from this using the transform function and adds the results to a collection created by makeCollection.

Link copied to clipboard
inline fun <T : Any, R> Provider<T?>.mapNonNull(crossinline transform: (T) -> R): Provider<R?>

Creates and returns a new Provider that maps non-null values of this using the transform function. Null values will be passed through without transformation.

inline fun <T : Any, R : Any> MutableProvider<T?>.mapNonNull(crossinline transform: (T) -> R?, crossinline untransform: (R) -> T?): MutableProvider<R?>

Creates and returns a new MutableProvider that maps non-null values of this bi-directionally using the provided transform and untransform functions. Null values will be passed through without transformation.

Link copied to clipboard
fun <K, V> Provider<List<Map<K, V>>>.mergeMaps(): Provider<Map<K, V>>

Creates and returns a new Provider that merges all Maps obtained from this into a single Map.

Link copied to clipboard
fun <K, V, M : MutableMap<in K, in V>> Provider<List<Map<K, V>>>.mergeMapsTo(makeMap: (size: Int) -> M): Provider<M>

Creates and returns a new Provider that merges all Maps obtained from this into a single Map, which is created by the makeMap function.

Link copied to clipboard
fun <T> mutableProvider(initialValue: T): MutableProvider<T>

Creates a new MutableProvider with the given initialValue.

fun <T> mutableProvider(lazyValue: () -> T): MutableProvider<T>

Creates a new MutableProvider that loads its value using the given lazyValue function. lazyValue should be a pure function.

fun <T> mutableProvider(lazyValue: () -> T, setValue: (T) -> Unit = {}): MutableProvider<T>

Creates a new MutableProvider that loads its value using the given lazyValue function and sets it using the given setValue function. lazyValue should be a pure function.

Link copied to clipboard
@JvmName(name = "observedList")
fun <E> MutableProvider<out MutableList<E>>.observed(): Provider<MutableList<E>>

Creates and returns a new Provider that observes the list of this and propagates changes appropriately.

@JvmName(name = "observedMap")
fun <K, V> MutableProvider<out MutableMap<K, V>>.observed(): Provider<MutableMap<K, V>>

Creates and returns a new Provider that observes the map of this and propagates changes appropriately.

@JvmName(name = "observedSet")
fun <E> MutableProvider<out MutableSet<E>>.observed(): Provider<MutableSet<E>>

Creates and returns a new Provider that observes the set of this and propagates changes appropriately.

Link copied to clipboard

Creates a new MutableProvider that returns a fallback value if the value of this is null. Conversely, if the returned provider's value is set a value equal to value, the value of this will be set to null.

fun <T> Provider<T?>.orElse(value: T): Provider<T>

Creates and returns a new Provider that returns a fallback value if the value of this is null.

fun <T> Provider<T?>.orElse(provider: Provider<T>): Provider<T>

Creates and returns a new Provider that returns a fallback value obtained through provider if the value of this is null.

@JvmName(name = "orElseNullable")
fun <T> Provider<T?>.orElse(provider: Provider<T>?): Provider<T?>

If provider is null, returns this. If provider is not null, creates and returns a new Provider that returns a fallback value obtained through provider if the value of this is null.

Link copied to clipboard
fun <T : Any> MutableProvider<T?>.orElseLazily(lazyValue: () -> T): MutableProvider<T>

Creates a new MutableProvider that returns a fallback value obtained through the lazyValue lambda if the value of this is null. Conversely, if the returned provider's value is set to a value equal to the one obtained through lazyValue, the value of this will be set to null.

fun <T> Provider<T?>.orElseLazily(lazyValue: () -> T): Provider<T>

Creates and returns a new Provider that returns a fallback value obtained through provider if the value of this is null.

Link copied to clipboard
fun <T> MutableProvider<T?>.orElseNew(newValue: () -> T): MutableProvider<T>

Creates a new MutableProvider that returns a fallback value which is re-created through the newValue lambda every time the value of this is set to null. Conversely, if the returned provider's value is set to a value equal to one returned by newValue, the value of this will be set to null.

fun <T> Provider<T?>.orElseNew(newValue: () -> T): Provider<T>

Creates a new Provider that returns a fallback value which is re-created through the newValue lambda every time the value of this is set to null.

Link copied to clipboard
fun <T> provider(value: T): Provider<T>

Creates a new Provider with the given value.

fun <T> provider(lazyValue: () -> T): Provider<T>

Creates a new Provider that loads its value using the given lazyValue function. lazyValue should be a pure function.

Link copied to clipboard
inline fun <T> Provider<T>.require(crossinline condition: (T) -> Boolean, crossinline message: (T) -> String): Provider<T>

Creates and returns a new Provider that throws an IllegalArgumentException with a message generated by message if condition fails.

Link copied to clipboard
inline fun <T : Any> Provider<T?>.requireNotNull(crossinline message: () -> String): Provider<T>

Creates and returns a new Provider that throws an IllegalArgumentException with a message generated by message if the value is null.

fun <T : Any> Provider<T?>.requireNotNull(message: String = "Required value was null."): Provider<T>

Creates and returns a new Provider that throws an IllegalArgumentException with message if the value is null.

Link copied to clipboard

Creates and returns a new Provider that combines all values of providers.

fun <T, R> strongCombinedProvider(providers: List<Provider<T>>, mapValue: (List<T>) -> R): Provider<R>

Creates and returns a new Provider that combines all values of providers and immediately maps them to R using mapValue.

Creates and returns a new Provider that combines the values of a and b.

fun <A, B, R> strongCombinedProvider(a: Provider<A>, b: Provider<B>, mapValue: (A, B) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a and b and immediately maps them to R using mapValue.

Creates and returns a new Provider that combines the values of a, b and c.

fun <A, B, C, R> strongCombinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, mapValue: (A, B, C) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b and c and immediately maps them to R using mapValue.

Creates and returns a new Provider that combines the values of a, b, c and d.

fun <A, B, C, D, R> strongCombinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, mapValue: (A, B, C, D) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b, c and d and immediately maps them to R using mapValue.

fun <A, B, C, D, E> strongCombinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>): Provider<Tuple5<A, B, C, D, E>>

Creates and returns a new Provider that combines the values of a, b, c, d and e.

fun <A, B, C, D, E, R> strongCombinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, mapValue: (A, B, C, D, E) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b, c, d and e and immediately maps them to R using mapValue.

fun <A, B, C, D, E, F> strongCombinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>): Provider<Tuple6<A, B, C, D, E, F>>

Creates and returns a new Provider that combines the values of a, b, c, d, e and f.

fun <A, B, C, D, E, F, R> strongCombinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, mapValue: (A, B, C, D, E, F) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b, c, d, e and f and immediately maps them to R using mapValue.

fun <A, B, C, D, E, F, G> strongCombinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>): Provider<Tuple7<A, B, C, D, E, F, G>>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f and g.

fun <A, B, C, D, E, F, G, R> strongCombinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>, mapValue: (A, B, C, D, E, F, G) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f and g and immediately maps them to R using mapValue.

fun <A, B, C, D, E, F, G, H> strongCombinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>, h: Provider<H>): Provider<Tuple8<A, B, C, D, E, F, G, H>>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f, g and h.

fun <A, B, C, D, E, F, G, H, R> strongCombinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>, h: Provider<H>, mapValue: (A, B, C, D, E, F, G, H) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f, g and h and immediately maps them to R using mapValue.

fun <A, B, C, D, E, F, G, H, I> strongCombinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>, h: Provider<H>, i: Provider<I>): Provider<Tuple9<A, B, C, D, E, F, G, H, I>>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f, g, h and i.

fun <A, B, C, D, E, F, G, H, I, R> strongCombinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>, h: Provider<H>, i: Provider<I>, mapValue: (A, B, C, D, E, F, G, H, I) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f, g, h and i and immediately maps them to R using mapValue.

fun <A, B, C, D, E, F, G, H, I, J> strongCombinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>, h: Provider<H>, i: Provider<I>, j: Provider<J>): Provider<Tuple10<A, B, C, D, E, F, G, H, I, J>>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f, g, h, i and j.

fun <A, B, C, D, E, F, G, H, I, J, R> strongCombinedProvider(a: Provider<A>, b: Provider<B>, c: Provider<C>, d: Provider<D>, e: Provider<E>, f: Provider<F>, g: Provider<G>, h: Provider<H>, i: Provider<I>, j: Provider<J>, mapValue: (A, B, C, D, E, F, G, H, I, J) -> R): Provider<R>

Creates and returns a new Provider that combines the values of a, b, c, d, e, f, g, h, i and j and immediately maps them to R using mapValue.

Link copied to clipboard
inline fun <T, R> Provider<Collection<T>>.strongFlatMapCollection(crossinline transform: (T) -> Iterable<R>): Provider<List<R>>

Creates and returns a new Provider that flat-maps the elements of the Collection obtained from this into a list using the transform function.

Link copied to clipboard
inline fun <T, R, C : MutableCollection<in R>> Provider<Collection<T>>.strongFlatMapCollectionTo(crossinline makeCollection: (size: Int) -> C, crossinline transform: (T) -> Iterable<R>): Provider<C>

Creates and returns a new Provider that flat-maps the elements of the Collection obtained from this into a collection created by makeCollection using the transform function.

Link copied to clipboard

Creates and returns a new Provider that maps to the provider that is the value of this.

Link copied to clipboard

Creates and returns a new Provider that flattens the List of Lists obtained from this.

Link copied to clipboard
@JvmName(name = "strongArrayGet")
fun <T> Provider<Array<T>>.strongGet(index: Int): Provider<T>
@JvmName(name = "strongArrayGet")
fun <T> Provider<Array<T>>.strongGet(index: Provider<Int>): Provider<T>
@JvmName(name = "strongListGet")
fun <T> Provider<List<T>>.strongGet(index: Int): Provider<T>
@JvmName(name = "strongListGet")
fun <T> Provider<List<T>>.strongGet(index: Provider<Int>): Provider<T>

Creates and returns a new Provider that maps to the element at index or throws NoSuchElementException.

Link copied to clipboard
@JvmName(name = "strongArrayGetCoerced")
fun <T> Provider<Array<T>>.strongGetCoerced(index: Int): Provider<T>
@JvmName(name = "strongArrayGetCoerced")
fun <T> Provider<Array<T>>.strongGetCoerced(index: Provider<Int>): Provider<T>
@JvmName(name = "strongListGetCoerced")
fun <T> Provider<List<T>>.strongGetCoerced(index: Int): Provider<T>
@JvmName(name = "strongListGetCoerced")
fun <T> Provider<List<T>>.strongGetCoerced(index: Provider<Int>): Provider<T>

Creates and returns a new Provider that maps to the element at index or the element at the closest valid index.

Link copied to clipboard
@JvmName(name = "strongArrayGetMod")
fun <T> Provider<Array<T>>.strongGetMod(index: Int): Provider<T>
@JvmName(name = "strongArrayGetMod")
fun <T> Provider<Array<T>>.strongGetMod(index: Provider<Int>): Provider<T>

Creates and returns a new Provider that maps to the element at index modulo the array size.

@JvmName(name = "strongListGetMod")
fun <T> Provider<List<T>>.strongGetMod(index: Int): Provider<T>
@JvmName(name = "strongListGetMod")
fun <T> Provider<List<T>>.strongGetMod(index: Provider<Int>): Provider<T>

Creates and returns a new Provider that maps to the element at index modulo the list size.

Link copied to clipboard
@JvmName(name = "strongArrayGetOrNull")
fun <T> Provider<Array<T>>.strongGetOrNull(index: Int): Provider<T?>
@JvmName(name = "strongArrayGetOrNull")
fun <T> Provider<Array<T>>.strongGetOrNull(index: Provider<Int>): Provider<T?>
@JvmName(name = "strongListGetOrNull")
fun <T> Provider<List<T>>.strongGetOrNull(index: Int): Provider<T?>
@JvmName(name = "strongListGetOrNull")
fun <T> Provider<List<T>>.strongGetOrNull(index: Provider<Int>): Provider<T?>

Creates and returns a new Provider that maps to the element at index or null if the index is out of bounds.

Link copied to clipboard
inline fun <T, R> Provider<Collection<T>>.strongMapEach(crossinline transform: (T) -> R): Provider<List<R>>

Creates and returns a new Provider that maps each element of the Collection obtained from this using the transform function.

Link copied to clipboard
inline fun <T, R : Any> Provider<Collection<T>>.strongMapEachNotNull(crossinline transform: (T) -> R?): Provider<List<R>>

Creates and returns a new Provider that maps each element of the Collection obtained from this using the transform function and filters out all null results.

Link copied to clipboard
inline fun <T, R : Any, C : MutableCollection<in R>> Provider<Collection<T>>.strongMapEachNotNullTo(crossinline makeCollection: (size: Int) -> C, crossinline transform: (T) -> R?): Provider<C>

Creates and returns a new Provider that maps each element of the Collection obtained from this using the transform function and filters out all null results. The results are added to a collection created by makeCollection.

Link copied to clipboard
inline fun <T, R, C : MutableCollection<in R>> Provider<Collection<T>>.strongMapEachTo(crossinline makeCollection: (size: Int) -> C, crossinline transform: (T) -> R): Provider<C>

Creates and returns a new Provider that maps each element of the Collection obtained from this using the transform function and adds the results to a collection created by makeCollection.

Link copied to clipboard
inline fun <T : Any, R> Provider<T?>.strongMapNonNull(crossinline transform: (T) -> R): Provider<R?>

Creates and returns a new Provider that maps non-null values of this using the transform function. Null values will be passed through without transformation.

inline fun <T : Any, R : Any> MutableProvider<T?>.strongMapNonNull(crossinline transform: (T) -> R?, crossinline untransform: (R) -> T?): MutableProvider<R?>

Creates and returns a new MutableProvider that maps non-null values of this bi-directionally using the provided transform and untransform functions. Null values will be passed through without transformation.

Link copied to clipboard

Creates and returns a new Provider that merges all Maps obtained from this into a single Map.

Link copied to clipboard
fun <K, V, M : MutableMap<in K, in V>> Provider<List<Map<K, V>>>.strongMergeMapsTo(makeMap: (size: Int) -> M): Provider<M>

Creates and returns a new Provider that merges all Maps obtained from this into a single Map, which is created by the makeMap function.

Link copied to clipboard
@JvmName(name = "strongObservedList")
fun <E> MutableProvider<out MutableList<E>>.strongObserved(): Provider<MutableList<E>>

Creates and returns a new Provider that observes the list of this and propagates changes appropriately.

@JvmName(name = "strongObservedMap")
fun <K, V> MutableProvider<out MutableMap<K, V>>.strongObserved(): Provider<MutableMap<K, V>>

Creates and returns a new Provider that observes the map of this and propagates changes appropriately.

@JvmName(name = "strongObservedSet")
fun <E> MutableProvider<out MutableSet<E>>.strongObserved(): Provider<MutableSet<E>>

Creates and returns a new Provider that observes the set of this and propagates changes appropriately.

Link copied to clipboard

Creates a new MutableProvider that returns a fallback value if the value of this is null. Conversely, if the returned provider's value is set a value equal to value, the value of this will be set to null.

fun <T> Provider<T?>.strongOrElse(value: T): Provider<T>

Creates and returns a new Provider that returns a fallback value if the value of this is null.

fun <T> Provider<T?>.strongOrElse(provider: Provider<T>): Provider<T>

Creates and returns a new Provider that returns a fallback value obtained through provider if the value of this is null.

@JvmName(name = "strongOrElseNullable")
fun <T> Provider<T?>.strongOrElse(provider: Provider<T>?): Provider<T?>

If provider is null, returns this. If provider is not null, creates and returns a new Provider that returns a fallback value obtained through provider if the value of this is null.

Link copied to clipboard
fun <T : Any> MutableProvider<T?>.strongOrElseLazily(lazyValue: () -> T): MutableProvider<T>

Creates a new MutableProvider that returns a fallback value obtained through the lazyValue lambda if the value of this is null. Conversely, if the returned provider's value is set to a value equal to the one obtained through lazyValue, the value of this will be set to null.

fun <T> Provider<T?>.strongOrElseLazily(lazyValue: () -> T): Provider<T>

Creates and returns a new Provider that returns a fallback value obtained through provider if the value of this is null.

Link copied to clipboard
fun <T> MutableProvider<T?>.strongOrElseNew(newValue: () -> T): MutableProvider<T>

Creates a new MutableProvider that returns a fallback value which is re-created through the newValue lambda every time the value of this is set to null. Conversely, if the returned provider's value is set to a value equal to one returned by newValue, the value of this will be set to null.

fun <T> Provider<T?>.strongOrElseNew(newValue: () -> T): Provider<T>

Creates a new Provider that returns a fallback value which is re-created through the newValue lambda every time the value of this is set to null.

Link copied to clipboard
inline fun <T> Provider<T>.strongRequire(crossinline condition: (T) -> Boolean, crossinline message: (T) -> String): Provider<T>

Creates and returns a new Provider that throws an IllegalArgumentException with a message generated by message if condition fails.

Link copied to clipboard
inline fun <T : Any> Provider<T?>.strongRequireNotNull(crossinline message: () -> String): Provider<T>

Creates and returns a new Provider that throws an IllegalArgumentException with a message generated by message if the value is null.

fun <T : Any> Provider<T?>.strongRequireNotNull(message: String = "Required value was null."): Provider<T>

Creates and returns a new Provider that throws an IllegalArgumentException with message if the value is null.