- java.lang.Object
-
- org.mybatis.dynamic.sql.AbstractListValueCondition<T>
-
- org.mybatis.dynamic.sql.where.condition.IsIn<T>
-
- All Implemented Interfaces:
VisitableCondition<T>
public class IsIn<T> extends AbstractListValueCondition<T>
-
-
Field Summary
-
Fields inherited from class org.mybatis.dynamic.sql.AbstractListValueCondition
emptyCallback, values
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedIsIn(Collection<T> values)protectedIsIn(Collection<T> values, Callback emptyCallback)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T> IsIn<T>empty()IsIn<T>filter(Predicate<? super T> predicate)If renderable, apply the predicate to each value in the list and return a new condition with the filtered values.<R> IsIn<R>map(Function<? super T,? extends R> mapper)If renderable, apply the mapping to each value in the list return a new condition with the mapped values.static <T> IsIn<T>of(Collection<T> values)static <T> IsIn<T>of(T... values)StringrenderCondition(String columnName, Stream<String> placeholders)IsIn<T>then(UnaryOperator<Stream<T>> valueStreamTransformer)Deprecated.replaced bymap(Function)andfilter(Predicate)IsIn<T>withListEmptyCallback(Callback callback)-
Methods inherited from class org.mybatis.dynamic.sql.AbstractListValueCondition
accept, filterSupport, mapSupport, mapValues, renderingSkipped, shouldRender
-
-
-
-
Constructor Detail
-
IsIn
protected IsIn(Collection<T> values)
-
IsIn
protected IsIn(Collection<T> values, Callback emptyCallback)
-
-
Method Detail
-
empty
public static <T> IsIn<T> empty()
-
renderCondition
public String renderCondition(String columnName, Stream<String> placeholders)
- Specified by:
renderConditionin classAbstractListValueCondition<T>
-
withListEmptyCallback
public IsIn<T> withListEmptyCallback(Callback callback)
- Specified by:
withListEmptyCallbackin classAbstractListValueCondition<T>
-
then
@Deprecated public IsIn<T> then(UnaryOperator<Stream<T>> valueStreamTransformer)
Deprecated.replaced bymap(Function)andfilter(Predicate)This method allows you to modify the condition's values before they are placed into the parameter map. For example, you could filter nulls, or trim strings, etc. This process will run before final rendering of SQL. If you filter values out of the stream, then final condition will not reference those values. If you filter all values out of the stream, then the condition will not render.- Parameters:
valueStreamTransformer- a UnaryOperator that will transform the value stream before the values are placed in the parameter map- Returns:
- new condition with the specified transformer
-
filter
public IsIn<T> filter(Predicate<? super T> predicate)
Description copied from class:AbstractListValueConditionIf renderable, apply the predicate to each value in the list and return a new condition with the filtered values. Else returns a condition that will not render (this). If all values are filtered out of the value list, then the condition will not render.- Specified by:
filterin classAbstractListValueCondition<T>- Parameters:
predicate- predicate applied to the values, if renderable- Returns:
- a new condition with filtered values if renderable, otherwise a condition that will not render.
-
map
public <R> IsIn<R> map(Function<? super T,? extends R> mapper)
If renderable, apply the mapping to each value in the list return a new condition with the mapped 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 the values, if renderable- Returns:
- a new condition with mapped values if renderable, otherwise a condition that will not render.
-
of
@SafeVarargs public static <T> IsIn<T> of(T... values)
-
of
public static <T> IsIn<T> of(Collection<T> values)
-
-