ValueNode is a common trait for Leaf(SetEntry)Node. Make sure javac
enforces this invariant.
Change-Id: I04a2173a0f1bddeb3c27b292b416c5e1a8a163d6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
*
* @param <T> Value type
*/
*
* @param <T> Value type
*/
-public interface LeafNode<T> extends ValueNode<T>, DataContainerChild {
+public non-sealed interface LeafNode<T> extends ValueNode<T>, DataContainerChild {
@Override
@SuppressWarnings("rawtypes")
default Class<LeafNode> contract() {
@Override
@SuppressWarnings("rawtypes")
default Class<LeafNode> contract() {
*
* @param <T> Value type
*/
*
* @param <T> Value type
*/
-public interface LeafSetEntryNode<T> extends ValueNode<T> {
+public non-sealed interface LeafSetEntryNode<T> extends ValueNode<T> {
@Override
@SuppressWarnings("rawtypes")
default Class<LeafSetEntryNode> contract() {
@Override
@SuppressWarnings("rawtypes")
default Class<LeafSetEntryNode> contract() {
*
* @param <V> Value of node, which needs to be a well-published simple value type.
*/
*
* @param <V> Value of node, which needs to be a well-published simple value type.
*/
-public interface ValueNode<V> extends NormalizedNode {
+public sealed interface ValueNode<V> extends NormalizedNode permits LeafNode, LeafSetEntryNode {