2 * Copyright (c) 2016 Ericsson 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
8 package org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper;
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;
25 * Created by eshuvka on 6/7/2016.
27 public class TestData<T extends DataObject> implements DataTreeModification<T> {
29 private final DataTreeIdentifier<T> path;
30 private final DataObjectModification<T> rootNode;
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);
39 public DataTreeIdentifier<T> getRootPath() {
44 public DataObjectModification<T> getRootNode() {
48 class Test<T extends DataObject> implements DataObjectModification<T> {
50 private final T dataObjBefore;
51 private final T dataObjAfter;
52 private final ModificationType modification;
54 Test(final T dataBefore, final T dataAfter, ModificationType modType) {
55 dataObjBefore = dataBefore;
56 dataObjAfter = dataAfter;
57 modification = modType;
61 public PathArgument getIdentifier() {
66 public Class<T> getDataType() {
71 public ModificationType getModificationType() {
76 public T getDataBefore() {
81 public T getDataAfter() {
86 public Collection<DataObjectModification<? extends DataObject>> getModifiedChildren() {
91 public <C extends ChildOf<? super T>> Collection<DataObjectModification<C>> getModifiedChildren(
97 public <H extends ChoiceIn<? super T> & DataObject, C extends ChildOf<? super H>>
98 Collection<DataObjectModification<C>> getModifiedChildren(Class<H> caseType, Class<C> childType) {
103 public <C extends ChildOf<? super T>> DataObjectModification<C> getModifiedChildContainer(Class<C> theClass) {
108 public <H extends ChoiceIn<? super T> & DataObject, C extends ChildOf<? super H>> DataObjectModification<C>
109 getModifiedChildContainer(Class<H> caseType, Class<C> child) {
114 public <C extends Augmentation<T> & DataObject> DataObjectModification<C> getModifiedAugmentation(
120 public <C extends Identifiable<K> & ChildOf<? super T>, K extends Identifier<C>> DataObjectModification<C>
121 getModifiedChildListItem(Class<C> theClass, K listKey) {
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) {
133 public DataObjectModification<? extends DataObject> getModifiedChild(PathArgument pathArgument) {