NormalizedNodeContainers come in two shapes: ordered and unordered,
make sure javac enforces this invariant.
Change-Id: Id4e1807d65e1da8ead48f55493fd0797726007b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
* @param <K> Child path argument type
* @param <V> Child Node type
*/
-public interface DistinctNodeContainer<K extends PathArgument, V extends NormalizedNode>
+public non-sealed interface DistinctNodeContainer<K extends PathArgument, V extends NormalizedNode>
extends NormalizedNodeContainer<V> {
/**
* {@inheritDoc}
*
* @param <V> Child Node type
*/
-public interface NormalizedNodeContainer<V extends NormalizedNode> extends NormalizedNode, OrderingAware {
+public sealed interface NormalizedNodeContainer<V extends NormalizedNode> extends NormalizedNode, OrderingAware
+ permits DistinctNodeContainer, OrderedNodeContainer {
/**
* {@inheritDoc}
*
*/
// FIXME: 9.0.0: we really want to do a List<@NonNull V> body(), but need to reconcile that with key-based lookup in
// implementations -- and those are using only a Map internally.
-public interface OrderedNodeContainer<V extends NormalizedNode>
+public non-sealed interface OrderedNodeContainer<V extends NormalizedNode>
extends NormalizedNodeContainer<V>, MixinNode, OrderingAware.User {
@Override
NodeIdentifier getIdentifier();