1 package com.atlassian.messagequeue.internal.core;
2
3 import java.util.Collections;
4 import java.util.HashMap;
5 import java.util.Map;
6
7
8
9
10
11
12
13
14 public class NestedMessage {
15 private Map<String, String> attributes = new HashMap<>();
16 private String payload;
17
18 public String getAttribute(String name) {
19 return attributes.get(name);
20 }
21
22 public NestedMessage addAttribute(String name, String value) {
23 attributes.put(name, value);
24 return this;
25 }
26
27 Map<String, String> getAttributesClone() {
28 return Collections.unmodifiableMap(attributes);
29 }
30
31 public String getPayload() {
32 return payload;
33 }
34
35 public NestedMessage setPayload(String payload) {
36 this.payload = payload;
37 return this;
38 }
39 }