@@ -344,16 +344,16 @@ public static final class UserDefined<T extends Comparable<T>, U extends UserDef
344
344
private final Column <T > column ;
345
345
private final Class <U > udpClass ;
346
346
private final String toString ;
347
- private final S o ;
347
+ private final S udpConfig ;
348
348
private static final String INSTANTIATION_ERROR_MESSAGE =
349
349
"Could not instantiate custom filter: %s. User defined predicates must be static classes with a default constructor." ;
350
350
351
- UserDefined (Column <T > column , Class <U > udpClass , S o ) {
351
+ UserDefined (Column <T > column , Class <U > udpClass , S udpConfigParam ) {
352
352
this .column = checkNotNull (column , "column" );
353
353
this .udpClass = checkNotNull (udpClass , "udpClass" );
354
354
String name = getClass ().getSimpleName ().toLowerCase ();
355
355
this .toString = name + "(" + column .getColumnPath ().toDotString () + ", " + udpClass .getName () + ")" ;
356
- this .o = o ;
356
+ this .udpConfig = udpConfigParam ;
357
357
358
358
// defensively try to instantiate the class early to make sure that it's possible
359
359
getUserDefinedPredicate ();
@@ -367,13 +367,11 @@ public Class<U> getUserDefinedPredicateClass() {
367
367
return udpClass ;
368
368
}
369
369
370
- public S getFilterObject () {
371
- return o ;
372
- }
373
-
374
370
public U getUserDefinedPredicate () {
375
371
try {
376
- return udpClass .newInstance ();
372
+ U udpInstance = udpClass .newInstance ();
373
+ udpInstance .configure (udpConfig );
374
+ return udpInstance ;
377
375
} catch (InstantiationException e ) {
378
376
throw new RuntimeException (String .format (INSTANTIATION_ERROR_MESSAGE , udpClass ), e );
379
377
} catch (IllegalAccessException e ) {
0 commit comments