You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2021/05/18 14:57:34 UTC

[GitHub] [qpid-proton-j] tabish121 commented on a change in pull request #40: PROTON-2299 Support encode and decode with multiple body sections

tabish121 commented on a change in pull request #40:
URL: https://github.com/apache/qpid-proton-j/pull/40#discussion_r634466429



##########
File path: proton-j/src/main/java/org/apache/qpid/proton/message/Message.java
##########
@@ -210,4 +213,55 @@ public static Message create(Header header,
     void clear();
 
     MessageError getError();
+
+    /**
+     * @return the total number of body {@link Section} elements contained in this {@link Message}
+     */
+    int getBodySectionCount();
+
+    /**
+     * Sets the body {@link Section} instances to use when encoding this message.  The value
+     * given replaces any existing section(s) assigned to this message through the {@link Message#setBody(Object)}
+     * or {@link #addBodySection(Section)} methods.  Calling this method with a null
+     * or empty collection is equivalent to calling the {@link #clear()} method.
+     *
+     * @param sections
+     *      The {@link Collection} of {@link Section} instance to assign this message.
+     *
+     * @return this {@link Message} instance.
+     */
+    Message setBodySections(Collection<Section> sections);

Review comment:
       I didn't intend to add that level of validation to the existing version of Message.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org