title: Converting POJO to protocol buffer request message
body: <p>Instead of using a Relationship.RelationshipGetRequest as a request and response.  Is there any way to convert the request/response to a POJO?</p>
  
  <p>I've seen this solution but its a bit more complicated than what I'm looking for:
  <a href="https://stackoverflow.com/questions/18261372/converting-a-protocol-buffer-to-a-pojo?rq=1">Converting a Protocol Buffer to a POJO</a></p>
  
  <p>I'm using Retrofit and Google Protocol Buffers.</p>
  
  <p>What I have:</p>
  
  <pre><code>public interface RelationshipService {
  
      @POST("/relation/get")
      Observable&lt;Relationships.RelationshipGetResponse&gt; getRelationship(
              @Body() Relationship.RelationshipGetRequest request
      );
  }
  </code></pre>
  
  <p>What I want to use:</p>
  
  <pre><code>public interface RelationshipService {
  
      @POST("/relation/get")
      Observable&lt;Relationship&gt; getRelationship(
              @Body() Relationship request
      );
  }
  </code></pre>
  
  <p>Relationship:</p>
  
  <pre><code>public class Relationship {
      private long mRelationshipId;
      private String mName;
      // etc. about 10 other properties..
  }
  </code></pre>
  
  <p>My Request ends up being like this where the request has to be built here..</p>
  
  <pre><code>mClient.createService(RelationshipService.class).getRelationship(Relationships.RelationshipGetRequest.newBuilder().setRelationshipId(-1).build()).subscribeOn(Schedulers.newThread())
          .observeOn(AndroidSchedulers.mainThread())
          .subscribe(new Subscriber&lt;Relationships.RelationshipGetResponse&gt;() {
              @Override
              public void onCompleted() {
  
              }
  
              @Override
              public void onError(Throwable e) {
                  Timber.e(e, "Error! " + e.getMessage());
              }
  
              @Override
              public void onNext(Relationships.RelationshipGetResponse relationship) {
  
                  String output = relationsip.getRelationship().getName();
                  Timber.i(output);
              }
          });
  </code></pre>