Context attributes as enumeration

Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
Fabio José 2019-08-26 17:20:41 -03:00
parent abbdf66686
commit 30e7fb681c
1 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,30 @@
package io.cloudevents.v03;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* The specification reserved words: the context attributes
*
* @author fabiojose
*
*/
public enum ContextAttributes {
id,
source,
specversion,
type,
time,
schemaurl,
datacontenttype,
datacontentencoding,
subject;
public static final List<String> VALUES =
Arrays.asList(ContextAttributes.values())
.stream()
.map(Enum::name)
.collect(Collectors.toList());
}