/** * 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 */ public static <T> MessageBuilder<T> fromMessage(Message<T> message) { return new MessageBuilder<>(message); }
/** * Create a new builder for a message with the given payload. * @param payload the payload */ public static <T> MessageBuilder<T> withPayload(T payload) { return new MessageBuilder<>(payload, new MessageHeaderAccessor()); }
/** * 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 */ public static <T> MessageBuilder<T> fromMessage(Message<T> message) { return new MessageBuilder<>(message); }
/** * Create a new builder for a message with the given payload. * @param payload the payload */ public static <T> MessageBuilder<T> withPayload(T payload) { return new MessageBuilder<>(payload, new MessageHeaderAccessor()); }
/** * 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 */ public static <T> MessageBuilder<T> fromMessage(Message<T> message) { return new MessageBuilder<>(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 */ public static <T> MessageBuilder<T> fromMessage(Message<T> message) { return new MessageBuilder<>(message); }
final MessageBuilder msgBuilder = new MessageBuilder("{0}/suhdp run -command \"suhilb\" -input /sufiles/{1} -output /seismicdata/mr_files/{2}/ -cwproot {3}", 4) .addArgument(arg0, 0).addArgument(arg3, 3); // later on: msgBuilder.addArgument(arg1, 1).addArgument(arg2, 2); // print result System.out.println(msgBuilder.build());
/** * Create a new builder for a message with the given payload. * @param payload the payload */ public static <T> MessageBuilder<T> withPayload(T payload) { return new MessageBuilder<>(payload, new MessageHeaderAccessor()); }
/** * Create a new builder for a message with the given payload. * @param payload the payload */ public static <T> MessageBuilder<T> withPayload(T payload) { return new MessageBuilder<>(payload, new MessageHeaderAccessor()); }