public static AnnotationPart[] annotationsFromSpec(PatternStreamSpecRaw pattern) {
Deque<AnnotationPart> parts = null;
if (pattern.isDiscardPartialsOnMatch()) {
parts = new ArrayDeque<AnnotationPart>();
parts.add(new AnnotationPart(DISCARDPARTIALSONMATCH));
}
if (pattern.isSuppressSameEventMatches()) {
if (parts == null) {
parts = new ArrayDeque<AnnotationPart>();
}
parts.add(new AnnotationPart(SUPPRESSOVERLAPPINGMATCHES));
}
if (parts == null) {
return null;
}