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 ( ) ; }
Marshals the given entity and and returns the equivalent Entity needed for the underlying Cloud Datastore API .