id&nbsp;setEntity(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;entity)</pre>
<div class="block">Set a new message entity. The existing entity <a href="../../../../jakarta/ws/rs/container/ContainerResponseContext.html#getEntityAnnotations--"><code>annotations</code></a> and <a href="../../../../jakarta/ws/rs/container/ContainerResponseContext.html#getMediaType--"><code>media type</code></a> are preserved.
 <