2 * Copyright (c) 2017 Cisco Systems, Inc. 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
9 package org.opendaylight.mdsal.binding.javav2.spec.runtime;
11 import static java.util.Objects.requireNonNull;
13 import com.google.common.annotations.Beta;
16 * Binding Namespace is structure of Java packages designed to prevent conflicts in YANG Java
17 * Binding, since Java does have only one namespace.
20 public enum BindingNamespaceType {
24 * Namespace containing all derived types, defined from grouping and data namespaces
27 Typedef("type"), Identity("ident"), Key("key"), Data("data"), Notification("data"), Operation("data"),
28 Grouping("grp"), Builder("dto");
30 private final String packagePrefix;
32 BindingNamespaceType(String packagePrefix) {
33 this.packagePrefix = requireNonNull(packagePrefix);
36 public String getPackagePrefix() {
40 public static Boolean isData(final BindingNamespaceType type) {
41 return isTreeData(type) || isNotificationData(type) || isOperationData(type);
44 public static Boolean isTreeData(final BindingNamespaceType type) {
45 return Data.equals(type);
48 public static Boolean isNotificationData(final BindingNamespaceType type) {
49 return Notification.equals(type);
52 public static Boolean isOperationData(final BindingNamespaceType type) {
53 return Operation.equals(type);
56 public static Boolean isGrouping(final BindingNamespaceType type) {
57 return Grouping.equals(type);