|
36 | 36 | import lombok.EqualsAndHashCode; |
37 | 37 | import lombok.Getter; |
38 | 38 | import lombok.NoArgsConstructor; |
| 39 | +import lombok.Setter; |
39 | 40 | import lombok.ToString; |
40 | 41 |
|
41 | 42 | /** |
|
50 | 51 | @NoArgsConstructor(access = AccessLevel.PACKAGE) |
51 | 52 | public class ChunkedResources<T> { |
52 | 53 |
|
| 54 | + @Getter |
| 55 | + @Setter(AccessLevel.PACKAGE) |
| 56 | + @XmlElement(name = "embedded") |
| 57 | + @com.fasterxml.jackson.annotation.JsonProperty("_embedded") |
| 58 | + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) |
53 | 59 | private Map<String, Collection<T>> content; |
54 | 60 |
|
| 61 | + @Getter |
| 62 | + @Setter(AccessLevel.PACKAGE) |
| 63 | + @XmlElement(name = "chunk") |
| 64 | + @com.fasterxml.jackson.annotation.JsonProperty("chunk") |
55 | 65 | private ChunkMetadata metadata; |
56 | 66 |
|
57 | 67 | /** |
@@ -106,38 +116,6 @@ public ChunkedResources(String key, Collection<T> content, ChunkMetadata metadat |
106 | 116 | this.metadata = metadata; |
107 | 117 | } |
108 | 118 |
|
109 | | - /** |
110 | | - * Returns the underlying elements. |
111 | | - * |
112 | | - * @return the content will never be {@literal null}. |
113 | | - * @since 0.11 |
114 | | - */ |
115 | | - @XmlElement(name = "embedded") |
116 | | - @com.fasterxml.jackson.annotation.JsonProperty("_embedded") |
117 | | - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) |
118 | | - public Map<String, Collection<T>> getContent() { |
119 | | - return content; |
120 | | - } |
121 | | - |
122 | | - void setContent(Map<String, Collection<T>> content) { |
123 | | - String key = this.content != null ? // |
124 | | - this.content.keySet().iterator().next() : content.keySet().iterator().next(); |
125 | | - Collection<T> collection = content.get(key); |
126 | | - this.content = Collections.singletonMap(key, collection); |
127 | | - } |
128 | | - |
129 | | - /** |
130 | | - * Metadata of this chunk. |
131 | | - * |
132 | | - * @return the metadata |
133 | | - * @since 0.11 |
134 | | - */ |
135 | | - @XmlElement(name = "chunk") |
136 | | - @com.fasterxml.jackson.annotation.JsonProperty("chunk") |
137 | | - public ChunkMetadata getMetadata() { |
138 | | - return metadata; |
139 | | - } |
140 | | - |
141 | 119 | /** |
142 | 120 | * Value object for pagination metadata. |
143 | 121 | * |
|
0 commit comments