Polish GenericMessage

This commit is contained in:
Rossen Stoyanchev 2013-10-21 16:29:01 -04:00
parent bafc73f147
commit 8917821e95
1 changed files with 6 additions and 5 deletions

View File

@ -31,11 +31,12 @@ import org.springframework.util.ObjectUtils;
* *
* @author Mark Fisher * @author Mark Fisher
* @since 4.0 * @since 4.0
*
* @see MessageBuilder * @see MessageBuilder
*/ */
public class GenericMessage<T> implements Message<T>, Serializable { public class GenericMessage<T> implements Message<T>, Serializable {
private static final long serialVersionUID = -9004496725833093406L; private static final long serialVersionUID = 4268801052358035098L;
private final T payload; private final T payload;
@ -48,19 +49,19 @@ public class GenericMessage<T> implements Message<T>, Serializable {
* *
* @param payload the message payload * @param payload the message payload
*/ */
protected GenericMessage(T payload) { public GenericMessage(T payload) {
this(payload, null); this(payload, null);
} }
/** /**
* Create a new message with the given payload. The provided map * Create a new message with the given payload. The provided map will be used to
* will be used to populate the message headers * populate the message headers
* *
* @param payload the message payload * @param payload the message payload
* @param headers message headers * @param headers message headers
* @see MessageHeaders * @see MessageHeaders
*/ */
protected GenericMessage(T payload, Map<String, Object> headers) { public GenericMessage(T payload, Map<String, Object> headers) {
Assert.notNull(payload, "payload must not be null"); Assert.notNull(payload, "payload must not be null");
if (headers == null) { if (headers == null) {
headers = new HashMap<String, Object>(); headers = new HashMap<String, Object>();