blob: 83d1d81112629c0ce57a20a7b590e13ac2c38f6f [file] [log] [blame]
sonu gupta1bb37b82016-11-11 16:51:18 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
sonu gupta1bb37b82016-11-11 16:51:18 +05303 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.yms.app.ydt;
18
sonu guptaeff184b2016-11-24 12:43:49 +053019import org.onosproject.yangutils.datamodel.YangSchemaNode;
20import org.onosproject.yms.app.ydt.exceptions.YdtException;
sonu gupta1bb37b82016-11-11 16:51:18 +053021
22import static org.onosproject.yms.app.ydt.YdtConstants.FMT_DUP_ENTRY;
23import static org.onosproject.yms.app.ydt.YdtConstants.errorMsg;
24import static org.onosproject.yms.ydt.YdtType.SINGLE_INSTANCE_NODE;
25
26/**
27 * Represents a single instance YANG data tree node.
28 */
29class YdtSingleInstanceNode extends YdtNode {
30
31 /**
32 * Creates a YANG single instance node object.
33 *
sonu guptaeff184b2016-11-24 12:43:49 +053034 * @param node schema of YDT single instance node
sonu gupta1bb37b82016-11-11 16:51:18 +053035 */
sonu guptaeff184b2016-11-24 12:43:49 +053036 YdtSingleInstanceNode(YangSchemaNode node) {
37 super(SINGLE_INSTANCE_NODE, node);
sonu gupta1bb37b82016-11-11 16:51:18 +053038 }
39
40 @Override
sonu guptaeff184b2016-11-24 12:43:49 +053041 public void validDuplicateEntryProcessing() throws YdtException {
42 throw new YdtException(errorMsg(FMT_DUP_ENTRY, getName()));
sonu gupta1bb37b82016-11-11 16:51:18 +053043 }
44}