Use E$$ to capture augmentation type
[mdsal.git] / binding / yang-binding / src / main / java / org / opendaylight / yangtools / yang / binding / Augmentable.java
1 /*
2  * Copyright (c) 2013 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.yangtools.yang.binding;
9
10 import org.eclipse.jdt.annotation.Nullable;
11
12 /**
13  * Augmentable (extensible) object which could carry additional data defined by a third-party extension, without
14  * introducing conflict between various extension.
15  *
16  * <p>
17  * This interface uses extended version of ExtensibleInterface pattern which also adds marker interface for
18  * augmentations (extensions) - {@link Augmentable}.
19  *
20  * @param <T>
21  *            Base class which should implements this interface and is target
22  *            for augmentation.
23  * @author Tony Tkacik
24  */
25 public interface Augmentable<T> {
26     /**
27      * Returns instance of augmentation.
28      *
29      * @param augmentationType Type of augmentation to be returned.
30      * @param <E$$> Type capture for augmentation type
31      * @return instance of augmentation.
32      */
33     // E$$ is an identifier which cannot be generated from models.
34     @SuppressWarnings("checkstyle:methodTypeParameterName")
35     <E$$ extends Augmentation<T>> @Nullable E$$ augmentation(Class<E$$> augmentationType);
36 }