@Test public void canConvertRequestVoteResponseMessageToAndFromProtobuf() throws Exception { RequestVoteResponse pojo = new RequestVoteResponse(12, true); RaftProto.RequestVoteResponse proto = RaftProto.RequestVoteResponse.newBuilder() .setTerm(12) .setVoteGranted(true) .build(); assertThat(ProtoUtils.convert(pojo)).isEqualTo(proto); assertThat(ProtoUtils.convert(proto)).isEqualTo(pojo); }
public static Entry convert(RaftEntry.Entry input) { return new Entry(input.getCommand().toByteArray(), input.getTerm()); }
ProtoUtils { public static Entry convert(RaftEntry.Entry input) { return new Entry(input.getCommand().toByteArray(), input.getTerm()); } }
ProtoUtils { public static Entry convert(RaftEntry.Entry input) { return new Entry(input.getCommand().toByteArray(), input.getTerm()); }  }
ProtoUtils { public static Entry convert(RaftEntry.Entry input) { return new Entry(input.getCommand().toByteArray(), input.getTerm()); }  static Entry convert(RaftEntry.Entry input); static RaftEntry.Entry convert(Entry input); static RequestVote convert(RaftProto.RequestVote request); static RaftProto.RequestVoteResponse convert(RequestVoteResponse requestVoteResponse); static RequestVoteResponse convert(RaftProto.RequestVoteResponse requestVoteResponse); static AppendEntries convert(RaftProto.AppendEntries request); static RaftProto.AppendEntries convert(AppendEntries request); static RaftProto.AppendEntriesResponse convert(AppendEntriesResponse response); static AppendEntriesResponse convert(RaftProto.AppendEntriesResponse response); static RaftProto.RequestVote convert(RequestVote request); }
ProtoUtils { public static Entry convert(RaftEntry.Entry input) { return new Entry(input.getCommand().toByteArray(), input.getTerm()); }  static Entry convert(RaftEntry.Entry input); static RaftEntry.Entry convert(Entry input); static RequestVote convert(RaftProto.RequestVote request); static RaftProto.RequestVoteResponse convert(RequestVoteResponse requestVoteResponse); static RequestVoteResponse convert(RaftProto.RequestVoteResponse requestVoteResponse); static AppendEntries convert(RaftProto.AppendEntries request); static RaftProto.AppendEntries convert(AppendEntries request); static RaftProto.AppendEntriesResponse convert(AppendEntriesResponse response); static AppendEntriesResponse convert(RaftProto.AppendEntriesResponse response); static RaftProto.RequestVote convert(RequestVote request); static Function<? super RaftProto.AppendEntriesResponse, ? extends AppendEntriesResponse> convertAppendResponse; static Function<? super RaftProto.RequestVoteResponse, ? extends RequestVoteResponse> convertVoteResponse; }