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