BUG-2661: Sonar issues for ofp-extension-api
[openflowplugin.git] / extension / openflowplugin-extension-api / src / main / java / org / opendaylight / openflowplugin / extension / api / AugmentTuple.java
1 /**
2  * Copyright (c) 2014 Cisco 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.extension.api;
9
10 import org.opendaylight.yangtools.yang.binding.Augmentable;
11 import org.opendaylight.yangtools.yang.binding.Augmentation;
12
13 /**
14  * Wrapper over augmentation and it's type in order to ease handing over and hooking of an augmentation 
15  * @param <E> augmentable type where wrapped augmentation belongs
16  */
17 public class AugmentTuple<E extends Augmentable<E>> {
18
19     private final Augmentation<E> augmentationObject;
20     private final Class<? extends Augmentation<E>> augmentationClass;
21
22     /**
23      * @param augmentationClass
24      * @param augmentationObject
25      */
26     public AugmentTuple(Class<? extends Augmentation<E>> augmentationClass, Augmentation<E> augmentationObject) {
27         this.augmentationClass = augmentationClass;
28         this.augmentationObject = augmentationObject;
29     }
30
31     /**
32      * @return instance of wrapped augmentation
33      */
34     public Augmentation<E> getAugmentationObject() {
35         return augmentationObject;
36     }
37
38     /**
39      * @return type of wrapped augmentation
40      */
41     public Class<? extends Augmentation<E>> getAugmentationClass() {
42         return augmentationClass;
43     }
44 }