6a77706f43a7cd1fe25f5c11ac4bc11e2e1d73f7
[mdsal.git] / binding / yang-binding / src / main / java / org / opendaylight / yangtools / yang / binding / Annotation.java
1 /*
2  * Copyright (c) 2019 PANTHEON.tech, s.r.o. 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 com.google.common.annotations.Beta;
11
12 /**
13  * Base marker interface implemented by all YANG-defined annotations through the facilities provided by
14  * <a href="https://tools.ietf.org/html/rfc7952">RFC7952</a>. This interface is not meant to be directly implemented,
15  * but rather serves as a hook for generated code.
16  *
17  * <p>
18  * An Annotation is a cross between a {@link TypeObject}, a {@link DataObject} and an {@link Augmentation}:
19  * <ul>
20  * <li>Similar to a {@code TypeObject} it can only hold a single scalar value, which has to be present.</li>
21  * <li>Similar to most {@code TypeObject}s, the value is available through {@link #getValue()} method</li>
22  * <li>Similar to a {@code DataObject}, the return type of {@link #getValue()} can point to a generated
23  *     {@code TypeObject}, not only a base YANG type</li>
24  * <li>Similar to an {@code Augmentation} it can be attached to other objects via {@link AnnotationAware} interface.
25  *     Unlike augmentations, though, annotations do not have a strict tie to the object they attach to.</li>
26  * </ul>
27  *
28  * @param <T> Value type
29  */
30 @Beta
31 public non-sealed interface Annotation<T> extends BindingObject, ValueAware<T> {
32
33 }