blob: 7d37929f5ad4fda4e937c8fa2d6b9b28d4b7395f [file] [log] [blame]
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +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.yangutils.datamodel;
18
19import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
20import org.onosproject.yangutils.utils.YangConstructType;
21
22/**
23 * Abstraction of YANG collision function. Abstracted to unify the collision
24 * detection functionality.
25 */
26public interface CollisionDetector {
27 /**
28 * Checks for the colliding child.
29 *
30 * @param identifierName name of identifier for which collision to be
31 * checked
32 * @param dataType type of the YANG construct for which collision to be
33 * checked
34 * @throws DataModelException if there is any collision in YANG rules in
35 * parsed data, corresponding exception should be thrown
36 */
37 void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException;
38
39 /**
40 * Check for the self collision.
41 *
42 * @param identifierName name of identifier for which collision to be
43 * checked
44 * @param dataType type of the YANG construct for which collision to be
45 * checked
46 * @throws DataModelException if there is any collision in YANG rules in
47 * parsed data, corresponding exception should be thrown
48 */
49 void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException;
50}