File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -304,7 +304,8 @@ Here's an example of implementing a LIKE condition that supports ESCAPE:
304
304
305
305
``` java
306
306
@NullMarked
307
- public class IsLikeEscape <T> extends AbstractSingleValueCondition<T > {
307
+ public class IsLikeEscape <T> extends AbstractSingleValueCondition<T >
308
+ implements AbstractSingleValueCondition .Filterable<T > , AbstractSingleValueCondition .Mappable<T > {
308
309
private static final IsLikeEscape<?> EMPTY = new IsLikeEscape<Object > (- 1 , null ) {
309
310
@Override
310
311
public Object value () {
@@ -354,6 +355,7 @@ public class IsLikeEscape<T> extends AbstractSingleValueCondition<T> {
354
355
return filterSupport(predicate, IsLikeEscape :: empty, this );
355
356
}
356
357
358
+ @Override
357
359
public <R > IsLikeEscape<R > map (Function<? super T , ? extends R > mapper ) {
358
360
return mapSupport(mapper, v - > new IsLikeEscape<> (v, escapeCharacter), IsLikeEscape :: empty);
359
361
}
@@ -374,4 +376,5 @@ Important notes:
374
376
2 . The class constructor accepts an escape character that will be rendered into an ESCAPE phrase
375
377
3 . The class overrides ` renderCondition ` and changes the library generated ` FragmentAndParameters ` to add the ESCAPE
376
378
phrase. ** This is the key to what's needed to implement a custom condition.**
377
- 4 . The class provides ` map ` and ` filter ` functions as is expected for any condition in the library
379
+ 4 . The class implements ` Filterable ` and ` Mappable ` to provide ` filter ` and ` map ` functions as is expected for most
380
+ conditions in the library
You can’t perform that action at this time.
0 commit comments