Source

class Source<T>

A source that is in the process of being mapped.

Parameters

<T>

the source type

Functions

Link copied to clipboard
open fun <R> as(adapter: (T) -> R): PropertyMapper.Source<R>
Return an adapted version of the source changed through the given adapter function.
Link copied to clipboard
open fun <R : Number?> asInt(adapter: (T) -> R): PropertyMapper.Source<Integer>
Return an adapted version of the source with Integer type.
Link copied to clipboard
open fun to(consumer: Consumer<T>)
Complete the mapping by passing any non-filtered value to the specified consumer.
open fun <R> to(instance: R, mapper: BiFunction<R, T, R>): R
Complete the mapping for any non-filtered value by applying the given function to an existing instance and returning a new one.
Link copied to clipboard
open fun toCall(runnable: Runnable)
Complete the mapping by calling the specified method when the value has not been filtered.
Link copied to clipboard
open fun <R> toInstance(factory: (T) -> R): R
Complete the mapping by creating a new instance from the non-filtered value.
Link copied to clipboard
open fun when(predicate: Predicate<T>): PropertyMapper.Source<T>
Return a filtered version of the source that won't map values that don't match the given predicate.
Link copied to clipboard
Return a filtered version of the source that will only map values equal to the specified object.
Link copied to clipboard
Return a filtered version of the source that will only map values that are false.
Link copied to clipboard
Return a filtered version of the source that will only map values that have a toString() containing actual text.
Link copied to clipboard
open fun <R : T?> whenInstanceOf(target: Class<R>): PropertyMapper.Source<R>
Return a filtered version of the source that will only map values that are an instance of the given type.
Link copied to clipboard
Return a filtered version of the source that won't map non-null values or suppliers that throw a NullPointerException.
Link copied to clipboard
open fun whenNot(predicate: Predicate<T>): PropertyMapper.Source<T>
Return a filtered version of the source that won't map values that match the given predicate.
Link copied to clipboard
Return a filtered version of the source that will only map values that are true.