Switch to MD-SAL APIs
[openflowplugin.git] / applications / notification-supplier / src / test / java / org / opendaylight / openflowplugin / applications / notification / supplier / impl / helper / TestData.java
1 /*
2  * Copyright (c) 2016 Ericsson Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper;
9
10 import java.util.Collection;
11 import org.opendaylight.mdsal.binding.api.DataObjectModification;
12 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
13 import org.opendaylight.mdsal.binding.api.DataTreeModification;
14 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
15 import org.opendaylight.yangtools.yang.binding.Augmentation;
16 import org.opendaylight.yangtools.yang.binding.ChildOf;
17 import org.opendaylight.yangtools.yang.binding.ChoiceIn;
18 import org.opendaylight.yangtools.yang.binding.DataObject;
19 import org.opendaylight.yangtools.yang.binding.Identifiable;
20 import org.opendaylight.yangtools.yang.binding.Identifier;
21 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
22 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
23
24 /**
25  * Created by eshuvka on 6/7/2016.
26  */
27 public class TestData<T extends DataObject> implements DataTreeModification<T> {
28
29     private final DataTreeIdentifier<T> path;
30     private final DataObjectModification<T> rootNode;
31
32     public TestData(final InstanceIdentifier<T> path, final T dataBefore, final T dataAfter,
33                     DataObjectModification.ModificationType modType) {
34         this.path = DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, path);
35         this.rootNode = new Test<>(dataBefore, dataAfter, modType);
36     }
37
38     @Override
39     public DataTreeIdentifier<T> getRootPath() {
40         return path;
41     }
42
43     @Override
44     public DataObjectModification<T> getRootNode() {
45         return rootNode;
46     }
47
48     class Test<T extends DataObject> implements DataObjectModification<T> {
49
50         private final T dataObjBefore;
51         private final T dataObjAfter;
52         private final ModificationType modification;
53
54         Test(final T dataBefore, final T dataAfter, ModificationType modType) {
55             dataObjBefore = dataBefore;
56             dataObjAfter = dataAfter;
57             modification = modType;
58         }
59
60         @Override
61         public PathArgument getIdentifier() {
62             return null;
63         }
64
65         @Override
66         public Class<T> getDataType() {
67             return null;
68         }
69
70         @Override
71         public ModificationType getModificationType() {
72             return modification;
73         }
74
75         @Override
76         public T getDataBefore() {
77             return dataObjBefore;
78         }
79
80         @Override
81         public T getDataAfter() {
82             return dataObjAfter;
83         }
84
85         @Override
86         public Collection<DataObjectModification<? extends DataObject>> getModifiedChildren() {
87             return null;
88         }
89
90         @Override
91         public <C extends ChildOf<? super T>> Collection<DataObjectModification<C>> getModifiedChildren(
92                 Class<C> childType) {
93             return null;
94         }
95
96         @Override
97         public <H extends ChoiceIn<? super T> & DataObject, C extends ChildOf<? super H>>
98                 Collection<DataObjectModification<C>> getModifiedChildren(Class<H> caseType, Class<C> childType) {
99             return null;
100         }
101
102         @Override
103         public <C extends ChildOf<? super T>> DataObjectModification<C> getModifiedChildContainer(Class<C> theClass) {
104             return null;
105         }
106
107         @Override
108         public <H extends ChoiceIn<? super T> & DataObject, C extends ChildOf<? super H>> DataObjectModification<C>
109                 getModifiedChildContainer(Class<H> caseType, Class<C> child) {
110             return null;
111         }
112
113         @Override
114         public <C extends Augmentation<T> & DataObject> DataObjectModification<C> getModifiedAugmentation(
115                 Class<C> theClass) {
116             return null;
117         }
118
119         @Override
120         public <C extends Identifiable<K> & ChildOf<? super T>, K extends Identifier<C>> DataObjectModification<C>
121                 getModifiedChildListItem(Class<C> theClass, K listKey) {
122             return null;
123         }
124
125         @Override
126         public <H extends ChoiceIn<? super T> & DataObject, C extends Identifiable<K> & ChildOf<? super H>,
127                 K extends Identifier<C>> DataObjectModification<C> getModifiedChildListItem(Class<H> caseType,
128                         Class<C> listItem, K listKey) {
129             return null;
130         }
131
132         @Override
133         public DataObjectModification<? extends DataObject> getModifiedChild(PathArgument pathArgument) {
134             return null;
135         }
136     }
137 }