1
2
3
4
5
6 package gov.nist.secauto.metaschema.core.metapath;
7
8 import gov.nist.secauto.metaschema.core.metapath.item.IItem;
9 import gov.nist.secauto.metaschema.core.util.ObjectUtils;
10
11 import java.util.stream.Stream;
12
13 import edu.umd.cs.findbugs.annotations.NonNull;
14
15 public interface ICollectionValue {
16
17
18
19
20
21
22
23
24 @NonNull
25 ISequence<?> asSequence();
26
27
28
29
30
31
32
33
34
35
36
37 @NonNull
38 static Stream<? extends IItem> normalizeAsItems(@NonNull ICollectionValue value) {
39 return value instanceof IItem
40 ? ObjectUtils.notNull(Stream.of((IItem) value))
41 : value.asSequence().stream();
42 }
43
44
45
46
47
48
49
50
51 @NonNull
52 Stream<? extends IItem> flatten();
53 }