public < P extends ParaObject > List < P > readAll ( List < String > keys ) { if ( keys == null || keys . isEmpty ( ) ) { return Collections . emptyList ( ) ; } final int size = this . chunkSize ; return IntStream . range ( 0 , getNumChunks ( keys , size ) ) . mapToObj ( i -> ( List < String > ) partitionList ( keys , i , size ) ) . map ( chunk -> { MultivaluedMap < String , String > ids = new MultivaluedHashMap <> ( ) ; ids . put ( "ids" , chunk ) ; return invokeGet ( "_batch" , ids ) ; } ) . map ( response -> ( List < P > ) this . getEntity ( response , List . class ) ) . map ( entity -> ( List < P > ) getItemsFromList ( entity ) ) . flatMap ( List :: stream ) . collect ( Collectors . toList ( ) ) ; }
Retrieves multiple objects from the data store .