public static BlocksWithLocations convert(BlocksWithLocationsProto blocks) { List<BlockWithLocationsProto> b = blocks.getBlocksList(); BlockWithLocations[] ret = new BlockWithLocations[b.size()]; int i = 0; for (BlockWithLocationsProto entry : b) { ret[i++] = convert(entry); } return new BlocksWithLocations(ret); }
return new BlocksWithLocations(new BlockWithLocations[0]); return new BlocksWithLocations( results.toArray(new BlockWithLocations[results.size()]));
public static BlocksWithLocations convert(BlocksWithLocationsProto blocks) { List<BlockWithLocationsProto> b = blocks.getBlocksList(); BlockWithLocations[] ret = new BlockWithLocations[b.size()]; int i = 0; for (BlockWithLocationsProto entry : b) { ret[i++] = convert(entry); } return new BlocksWithLocations(ret); }
public static BlocksWithLocations convert(BlocksWithLocationsProto blocks) { List<BlockWithLocationsProto> b = blocks.getBlocksList(); BlockWithLocations[] ret = new BlockWithLocations[b.size()]; int i = 0; for (BlockWithLocationsProto entry : b) { ret[i++] = convert(entry); } return new BlocksWithLocations(ret); }
return new BlocksWithLocations(new BlockWithLocations[0]); return new BlocksWithLocations( results.toArray(new BlockWithLocations[results.size()]));
return new BlocksWithLocations(new BlockWithLocations[0]); return new BlocksWithLocations( results.toArray(new BlockWithLocations[results.size()])); } finally {
return new BlocksWithLocations(new BlockWithLocations[0]); return new BlocksWithLocations( results.toArray(new BlockWithLocations[results.size()]));
return new BlocksWithLocations(new BlockWithLocations[0]); return new BlocksWithLocations( results.toArray(new BlockWithLocations[results.size()]));
@Test public void testConvertBlocksWithLocations() { BlockWithLocations[] list = new BlockWithLocations[] { getBlockWithLocations(1), getBlockWithLocations(2) }; BlocksWithLocations locs = new BlocksWithLocations(list); BlocksWithLocationsProto locsProto = PBHelper.convert(locs); BlocksWithLocations locs2 = PBHelper.convert(locsProto); BlockWithLocations[] blocks = locs.getBlocks(); BlockWithLocations[] blocks2 = locs2.getBlocks(); assertEquals(blocks.length, blocks2.length); for (int i = 0; i < blocks.length; i++) { compare(blocks[i], blocks2[i]); } }