code: private BaseEntity<?> marshal() {
      marshalKey();
      if (key instanceof Key) {
        entityBuilder = Entity.newBuilder((Key) key);
      } else {
        entityBuilder = FullEntity.newBuilder(key);
      }
      marshalFields();
      marshalAutoTimestampFields();
      if (intent == Intent.UPDATE) {
        marshalVersionField();
      }
      marshalEmbeddedFields();
      return entityBuilder.build();
    }
docs: Marshals the given entity and and returns the equivalent Entity needed for the underlying Cloud
  Datastore API.
  
  @return A native entity that is equivalent to the POJO being marshalled. The returned value
  could either be a FullEntity or Entity.