类 PropertyMapper.Source<T>
java.lang.Object
cn.taketoday.util.PropertyMapper.Source<T>
- 类型参数:
T- the source type
- 封闭类:
- PropertyMapper
A source that is in the process of being mapped.
-
方法概要
修饰符和类型方法说明<R> PropertyMapper.Source<R>Return an adapted version of the source changed via the given adapter function.<R extends Number>
PropertyMapper.Source<Integer>Return an adapted version of the source withIntegertype.voidComplete the mapping by passing any non-filtered value to the specified consumer.voidComplete the mapping by calling the specified method when the value has not been filtered.<R> RtoInstance(Function<T, R> factory) Complete the mapping by creating a new instance from the non-filtered value.Return a filtered version of the source that won't map values that don't match the given predicate.whenEqualTo(Object object) Return a filtered version of the source that will only map values equal to the specifiedobject.Return a filtered version of the source that will only map values that arefalse.Return a filtered version of the source that will only map values that have atoString()containing actual text.<R extends T>
PropertyMapper.Source<R>whenInstanceOf(Class<R> target) Return a filtered version of the source that will only map values that are an instance of the given type.Return a filtered version of the source that won't map non-null values or suppliers that throw aNullPointerException.Return a filtered version of the source that won't map values that match the given predicate.whenTrue()Return a filtered version of the source that will only map values that aretrue.
-
方法详细资料
-
asInt
Return an adapted version of the source withIntegertype.- 类型参数:
R- the resulting type- 参数:
adapter- an adapter to convert the current value to a number.- 返回:
- a new adapted source instance
-
as
Return an adapted version of the source changed via the given adapter function.- 类型参数:
R- the resulting type- 参数:
adapter- the adapter to apply- 返回:
- a new adapted source instance
-
whenNonNull
Return a filtered version of the source that won't map non-null values or suppliers that throw aNullPointerException.- 返回:
- a new filtered source instance
-
whenTrue
Return a filtered version of the source that will only map values that aretrue.- 返回:
- a new filtered source instance
-
whenFalse
Return a filtered version of the source that will only map values that arefalse.- 返回:
- a new filtered source instance
-
whenHasText
Return a filtered version of the source that will only map values that have atoString()containing actual text.- 返回:
- a new filtered source instance
-
whenEqualTo
Return a filtered version of the source that will only map values equal to the specifiedobject.- 参数:
object- the object to match- 返回:
- a new filtered source instance
-
whenInstanceOf
Return a filtered version of the source that will only map values that are an instance of the given type.- 类型参数:
R- the target type- 参数:
target- the target type to match- 返回:
- a new filtered source instance
-
whenNot
Return a filtered version of the source that won't map values that match the given predicate.- 参数:
predicate- the predicate used to filter values- 返回:
- a new filtered source instance
-
when
Return a filtered version of the source that won't map values that don't match the given predicate.- 参数:
predicate- the predicate used to filter values- 返回:
- a new filtered source instance
-
to
Complete the mapping by passing any non-filtered value to the specified consumer.- 参数:
consumer- the consumer that should accept the value if it's not been filtered
-
toInstance
Complete the mapping by creating a new instance from the non-filtered value.- 类型参数:
R- the resulting type- 参数:
factory- the factory used to create the instance- 返回:
- the instance
- 抛出:
NoSuchElementException- if the value has been filtered
-
toCall
Complete the mapping by calling the specified method when the value has not been filtered.- 参数:
runnable- the method to call if the value has not been filtered
-