Private list of extension format

Package level method to get that list

Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
Fabio José 2019-09-02 21:58:36 -03:00
parent a9635b5d93
commit 7ad4d4e308
1 changed files with 11 additions and 0 deletions

View File

@ -56,6 +56,8 @@ public class CloudEventImpl<T> implements CloudEvent<AttributesImpl, T> {
@NotNull
private final Map<String, Object> extensions;
private final Set<ExtensionFormat> extensionsFormats;
CloudEventImpl(AttributesImpl attributes, T data,
Set<ExtensionFormat> extensions) {
this.attributes = attributes;
@ -65,6 +67,15 @@ public class CloudEventImpl<T> implements CloudEvent<AttributesImpl, T> {
.map(ExtensionFormat::memory)
.collect(Collectors.toMap(InMemoryFormat::getKey,
InMemoryFormat::getValue));
this.extensionsFormats = extensions;
}
/**
* Used by the {@link Accessor} to access the set of {@link ExtensionFormat}
*/
Set<ExtensionFormat> getExtensionsFormats() {
return extensionsFormats;
}
@JsonUnwrapped