static Operation fromPb(LogEntryOperation operationPb) { return newBuilder(operationPb.getId(), operationPb.getProducer()) .setFirst(operationPb.getFirst()) .setLast(operationPb.getLast()) .build(); } }
@Test public void testToBuilder() { compareLogOperation(OPERATION, OPERATION.toBuilder().build()); Operation operation = OPERATION .toBuilder() .setId("newId") .setProducer("newProducer") .setFirst(false) .setLast(true) .build(); assertEquals("newId", operation.getId()); assertEquals("newProducer", operation.getProducer()); assertFalse(operation.first()); assertTrue(operation.last()); operation = operation.toBuilder().setId(ID).setProducer(PRODUCER).setFirst(FIRST).setLast(LAST).build(); compareLogOperation(OPERATION, operation); }
static Operation fromPb(LogEntryOperation operationPb) { return newBuilder(operationPb.getId(), operationPb.getProducer()) .setFirst(operationPb.getFirst()) .setLast(operationPb.getLast()) .build(); } }