You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2024/06/26 13:58:12 UTC

(camel) branch main updated: CAMEL-20889: Added javadoc to point to the new helper method.

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new d91d4e0cbe2 CAMEL-20889: Added javadoc to point to the new helper method.
d91d4e0cbe2 is described below

commit d91d4e0cbe2cc5ce6e174642e6f1ba0f7bf8ad26
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Jun 26 15:58:01 2024 +0200

    CAMEL-20889: Added javadoc to point to the new helper method.
---
 core/camel-api/src/main/java/org/apache/camel/Message.java | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/core/camel-api/src/main/java/org/apache/camel/Message.java b/core/camel-api/src/main/java/org/apache/camel/Message.java
index 7d16a208081..6b9b8a0aa06 100644
--- a/core/camel-api/src/main/java/org/apache/camel/Message.java
+++ b/core/camel-api/src/main/java/org/apache/camel/Message.java
@@ -248,11 +248,15 @@ public interface Message {
      * being able to be re-read again. You can enable stream caching and call the {@link StreamCache#reset()} method to
      * reset the stream to be able to re-read again (if possible). See more details about
      * <a href="http://camel.apache.org/stream-caching.html">stream caching</a>.
+     * <p/>
+     * The helper method {@link org.apache.camel.support.ExchangeHelper#getBodyAndResetStreamCache(Exchange, Class)}
+     * can be used instead that gets the body, convert to the given type, and ensures to reset the body if its stream based.
      *
      * @param  type                    the type that the body
      * @return                         the body of the message as the specified type, or <tt>null</tt> if body does not
      *                                 exist
      * @throws TypeConversionException is thrown if error during type conversion
+     * @see org.apache.camel.support.ExchangeHelper#getBodyAndResetStreamCache(Exchange, Class)
      */
     <T> T getBody(Class<T> type);
 
@@ -263,10 +267,14 @@ public interface Message {
      * being able to be re-read again. You can enable stream caching and call the {@link StreamCache#reset()} method to
      * reset the stream to be able to re-read again (if possible). See more details about
      * <a href="http://camel.apache.org/stream-caching.html">stream caching</a>.
+     * <p/>
+     * The helper method {@link org.apache.camel.support.ExchangeHelper#getBodyAndResetStreamCache(Exchange, Class)}
+     * can be used instead that gets the body, convert to the given type, and ensures to reset the body if its stream based.
      *
      * @param  type                    the type that the body
      * @return                         the body of the message as the specified type, is never <tt>null</tt>.
      * @throws InvalidPayloadException Is thrown if the body being <tt>null</tt> or wrong class type
+     * @see org.apache.camel.support.ExchangeHelper#getBodyAndResetStreamCache(Exchange, Class)
      */
     <T> T getMandatoryBody(Class<T> type) throws InvalidPayloadException;