Package org.mybatis.dynamic.sql
Interface AbstractTwoValueCondition.Mappable<T>
- Type Parameters:
T- the Java type related to the database column type
- All Known Implementing Classes:
IsBetween,IsBetweenWhenPresent,IsNotBetween,IsNotBetweenWhenPresent
- Enclosing class:
AbstractTwoValueCondition<T>
public static interface AbstractTwoValueCondition.Mappable<T>
Conditions may implement Mappable to alter condition values or types during rendering.
If a condition is Mappable, then a user may add a mapper to the usage of the condition that can alter the values of a condition, or change that datatype.
Implementations of Mappable may call
AbstractTwoValueCondition.mapSupport(Function, Function, BiFunction, Supplier) as
a common implementation of the mapping algorithm.
-
Method Summary
Modifier and TypeMethodDescription<R> AbstractTwoValueCondition<R> If renderable, apply the mapping to both values and return a new condition with the new values.<R> AbstractTwoValueCondition<R> map(Function<? super @NonNull T, ? extends R> mapper1, Function<? super @NonNull T, ? extends R> mapper2) If renderable, apply the mappings to the values and return a new condition with the new values.
-
Method Details
-
map
<R> AbstractTwoValueCondition<R> map(Function<? super @NonNull T, ? extends R> mapper1, Function<? super @NonNull T, ? extends R> mapper2) If renderable, apply the mappings to the values and return a new condition with the new values. Else return a condition that will not render (this).- Type Parameters:
R- type of the new condition- Parameters:
mapper1- a mapping function to apply to the first value, if renderablemapper2- a mapping function to apply to the second value, if renderable- Returns:
- a new condition with the result of applying the mappers to the values of this condition, if renderable, otherwise a condition that will not render.
-
map
If renderable, apply the mapping to both values and return a new condition with the new values. Else return a condition that will not render (this).- Type Parameters:
R- type of the new condition- Parameters:
mapper- a mapping function to apply to both values, if renderable- Returns:
- a new condition with the result of applying the mappers to the values of this condition, if renderable, otherwise a condition that will not render.
-