BindResult

class BindResult<T>

A container object to return the result of a Binder bind operation. May contain either a successfully bound object or an empty result.

Author

Phillip Webb

Madhura Bhave

Since

2.0.0

Parameters

<T>

the result type

Functions

Link copied to clipboard
open fun equals(obj: Any): Boolean
Link copied to clipboard
open fun get(): T
Return the object that was bound or throw a NoSuchElementException if no value was bound.
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun ifBound(consumer: Consumer<in T>)
Invoke the specified consumer with the bound value, or do nothing if no value has been bound.
Link copied to clipboard
open fun isBound(): Boolean
Returns true if a result was bound.
Link copied to clipboard
open fun <U> map(mapper: (in T) -> out U): BindResult<U>
Apply the provided mapping function to the bound value, or return an updated unbound result if no value has been bound.
Link copied to clipboard
open fun orElse(other: T): T
Return the object that was bound, or other if no value has been bound.
Link copied to clipboard
open fun orElseGet(other: Supplier<out T>): T
Return the object that was bound, or the result of invoking other if no value has been bound.
Link copied to clipboard
open fun <X : Throwable?> orElseThrow(exceptionSupplier: Supplier<out X>): T
Return the object that was bound, or throw an exception to be created by the provided supplier if no value has been bound.