2 * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.model.api;
10 import java.util.Optional;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
14 * Package-internal helper methods for use in interface default methods.
16 * @author Robert Varga
19 final class HelperMethods {
20 private HelperMethods() {
24 static boolean isDataNode(final Optional<DataSchemaNode> optNode) {
25 return optNode.isPresent() && isDataNode(optNode.get());
28 private static boolean isDataNode(final DataSchemaNode node) {
29 return node instanceof ContainerSchemaNode || node instanceof LeafSchemaNode
30 || node instanceof LeafListSchemaNode || node instanceof ListSchemaNode
31 || node instanceof AnydataSchemaNode || node instanceof AnyxmlSchemaNode;