public static Selector selectAs ( final String propName , final String alias , final Function transform ) { return new Selector ( propName , alias ) { @ Override public void handleRow ( int index , Map < String , Object > row , Object item , Map < String , FieldAccess > fields ) { if ( ! path && fields != null ) { row . put ( this . name , transform . apply ( fields . get ( this . name ) . getValue ( item ) ) ) ; } else { row . put ( alias , transform . apply ( BeanUtils . atIndex ( item , propName ) ) ) ; } } @ Override public void handleStart ( Collection < ? > results ) { } @ Override public void handleComplete ( List < Map < String , Object > > rows ) { } } ; }
Selects but allows having a different alias for the output .