public GroupedPropertyLoader splitKeyAndGroup ( final String keyDelimiter ) { return group ( new BiFunction < String , String , Tuple3 < String , String , String > > ( ) { public Tuple3 < String , String , String > apply ( String key , String value ) { String [ ] keyTokens = key . split ( keyDelimiter , 2 ) ; if ( keyTokens . length == 1 ) { keyTokens = new String [ ] { "" , keyTokens [ 0 ] } ; } return Tuple3 . tuple3 ( keyTokens [ 0 ] , keyTokens [ 1 ] , value ) ; } } ) ; }
Split the key into 2 and use the first token to group