/** * Create a builder for a new {@link Message} instance pre-populated with all of the headers copied from the * provided message. The payload of the provided Message will also be used as the payload for the new message. * @param message the Message from which the payload and all headers will be copied * @param <T> The type of the payload. * @return A MutableMessageBuilder. */ public static <T> MutableMessageBuilder<T> fromMessage(Message<T> message) { Assert.notNull(message, "'message' must not be null"); return new MutableMessageBuilder<T>(message); }
/** * Create a builder for a new {@link Message} instance pre-populated with all of the headers copied from the * provided message. The payload of the provided Message will also be used as the payload for the new message. * @param message the Message from which the payload and all headers will be copied * @param <T> The type of the payload. * @return A MutableMessageBuilder. */ public static <T> MutableMessageBuilder<T> fromMessage(Message<T> message) { Assert.notNull(message, "'message' must not be null"); return new MutableMessageBuilder<T>(message); }