class VotePayloadConverter implements PayloadConverter<Vote> {

  @Override
  public BytesValue convertToPayload(final Vote vote) {
    logger.debug("Convert to payload from {}", vote);
    final Map<String, Object> map = new HashMap<>();
    map.put("Name", vote.getOperationName());
    map.put("Args", vote.getCandidates());
    return mapper.marshal(map);
  }

}