Merge "OF plugin classes must have a strict dependency on Connection Service"
[controller.git] / opendaylight / sal / yang-prototype / code-generator / binding-model-api / src / main / java / org / opendaylight / controller / sal / binding / model / api / AnnotationType.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.controller.sal.binding.model.api;
9
10 import java.util.List;
11
12 /**
13  * The Annotation Type interface is designed to hold information about
14  * annotation for any type that could be annotated in Java.
15  * <br>
16  * For sake of simplicity the Annotation Type is not designed to model exact
17  * behaviour of annotation mechanism, but just to hold information needed to
18  * model annotation over java Type definition.
19  */
20 public interface AnnotationType extends Type {
21
22     /**
23      * Returns the List of Annotations.
24      * <br>
25      * Each Annotation Type MAY have defined multiple Annotations.
26      *
27      * @return the List of Annotations.
28      */
29     public List<AnnotationType> getAnnotations();
30
31     /**
32      * Returns Parameter Definition assigned for given parameter name.
33      * <br>
34      * If Annotation does not contain parameter with specified param name,
35      * the method MAY return <code>null</code> value.
36      *
37      * @param paramName Parameter Name
38      * @return Parameter Definition assigned for given parameter name.
39      */
40     public Parameter getParameter(final String paramName);
41
42     /**
43      * Returns List of all parameters assigned to Annotation Type.
44      *
45      * @return List of all parameters assigned to Annotation Type.
46      */
47     public List<Parameter> getParameters();
48
49     /**
50      * Returns List of parameter names.
51      *
52      * @return List of parameter names.
53      */
54     public List<String> getParameterNames();
55
56     /**
57      * Returns <code>true</code> if annotation contains parameters.
58      *
59      * @return <code>true</code> if annotation contains parameters.
60      */
61     public boolean containsParameters();
62
63     /**
64      * Annotation Type parameter interface. For simplicity the Parameter
65      * contains values and value types as Strings. Every annotation which
66      * contains parameters could contain either single parameter or array of
67      * parameters. To model this purposes the by contract if the parameter
68      * contains single parameter the {@link #getValues()} method will return
69      * empty List and {@link #getValue()} MUST always return non-<code>null</code>
70      * parameter. If the Parameter holds List of values the singular {@link
71      * #getValue()} parameter MAY return <code>null</code> value.
72      */
73     interface Parameter {
74
75         /**
76          * Returns the Name of the parameter.
77          *
78          * @return the Name of the parameter.
79          */
80         public String getName();
81
82         /**
83          * Returns value in String format if Parameter contains singular value,
84          * otherwise MAY return <code>null</code>.
85          *
86          * @return value in String format if Parameter contains singular value.
87          */
88         public String getValue();
89
90         /**
91          * Returns List of Parameter assigned values in order in which they
92          * were assigned for given parameter name.
93          * <br>
94          * If there are multiple values assigned for given parameter name the
95          * method MUST NOT return empty List.
96          *
97          * @return List of Parameter assigned values in order in which they
98          * were assigned for given parameter name.
99          */
100         public List<String> getValues();
101     }
102 }