public Response executeCommand(ICommand command, Builder<?> builder, long timeout) { ByteString payload = (builder != null) ? builder.build().toByteString() : ByteString.EMPTY; Command.Builder commandBuilder = buildCommand(command, payload); int tag = commandBuilder.getTag(); connection.send(commandBuilder.build()); return waitForResponse(tag, timeout); }
@Override @SuppressWarnings("unchecked") public A parseData(Data data) throws Exception { return (A) data.merge(builder.clone()).build(); }
public BuilderParser(Builder builder) { this.builder = builder.clone().clear(); }