/** * Constructs a Message for the given {@code payload} and {@code meta data}. The given {@code metaData} is * merged with the MetaData from the correlation data of the current unit of work, if present. * In case the {@code payload == null}, {@link Void} will be used as the {@code payloadType}. * * @param payload The payload for the message as a generic {@code T} * @param metaData The meta data {@link Map} for the message */ @SuppressWarnings("unchecked") public GenericMessage(T payload, Map<String, ?> metaData) { this(getDeclaredPayloadType(payload), payload, metaData); }
/** * Constructor to reconstruct a Message using existing data. Note that no correlation data * from a UnitOfWork is attached when using this constructor. If you're constructing a new * Message, use {@link #GenericMessage(Object, Map)} instead. * * @param identifier The identifier of the Message * @param payload The payload of the message * @param metaData The meta data of the message * @throws NullPointerException when the given {@code payload} is {@code null}. */ @SuppressWarnings("unchecked") public GenericMessage(String identifier, T payload, Map<String, ?> metaData) { this(identifier, getDeclaredPayloadType(payload), payload, metaData); }
/** * Constructs a Message for the given {@code payload} and {@code meta data}. The given {@code metaData} is * merged with the MetaData from the correlation data of the current unit of work, if present. * In case the {@code payload == null}, {@link Void} will be used as the {@code payloadType}. * * @param payload The payload for the message as a generic {@code T} * @param metaData The meta data {@link Map} for the message */ @SuppressWarnings("unchecked") public GenericMessage(T payload, Map<String, ?> metaData) { this(getDeclaredPayloadType(payload), payload, metaData); }
/** * Constructs a Message for the given {@code payload} and {@code meta data}. The given {@code metaData} is * merged with the MetaData from the correlation data of the current unit of work, if present. * In case the {@code payload == null}, {@link Void} will be used as the {@code payloadType}. * * @param payload The payload for the message as a generic {@code T} * @param metaData The meta data {@link Map} for the message */ @SuppressWarnings("unchecked") public GenericMessage(T payload, Map<String, ?> metaData) { this(getDeclaredPayloadType(payload), payload, metaData); }
/** * Constructor to reconstruct a Message using existing data. Note that no correlation data * from a UnitOfWork is attached when using this constructor. If you're constructing a new * Message, use {@link #GenericMessage(Object, Map)} instead. * * @param identifier The identifier of the Message * @param payload The payload of the message * @param metaData The meta data of the message * @throws NullPointerException when the given {@code payload} is {@code null}. */ @SuppressWarnings("unchecked") public GenericMessage(String identifier, T payload, Map<String, ?> metaData) { this(identifier, getDeclaredPayloadType(payload), payload, metaData); }
/** * Constructor to reconstruct a Message using existing data. Note that no correlation data * from a UnitOfWork is attached when using this constructor. If you're constructing a new * Message, use {@link #GenericMessage(Object, Map)} instead. * * @param identifier The identifier of the Message * @param payload The payload of the message * @param metaData The meta data of the message * @throws NullPointerException when the given {@code payload} is {@code null}. */ @SuppressWarnings("unchecked") public GenericMessage(String identifier, T payload, Map<String, ?> metaData) { this(identifier, getDeclaredPayloadType(payload), payload, metaData); }