public static < F , T > Function < F , T > wrap ( Expression < T > projection ) { Path < ? > path = projection . accept ( PathExtractor . DEFAULT , null ) ; if ( path != null ) { final Evaluator < T > ev = createEvaluator ( path . getRoot ( ) , projection ) ; return new Function < F , T > ( ) { @ Override public T apply ( F input ) { return ev . evaluate ( input ) ; } } ; } else { throw new IllegalArgumentException ( "No path in " + projection ) ; } }
Wrap a Querydsl expression into a Guava function