Extended binding-model-api to support of Enclosed Generated Types and TOs.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / binding-model-api / src / main / java / org / opendaylight / controller / sal / binding / model / api / type / builder / AnnotationTypeBuilder.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.type.builder;
9
10 import java.util.List;
11
12 import org.opendaylight.controller.sal.binding.model.api.AnnotationType;
13 import org.opendaylight.controller.sal.binding.model.api.Type;
14
15 /**
16  * Annotation Type Builder Interface serves for creation and instantiation of
17  * immutable copy of Annotation Type. The Annotation Type Builder extends
18  * from {@link Type} interface. The Annotation Type contains set of methods
19  * which are capable to provide information about other Annotation Types and
20  * Annotation Parameters.
21  *
22  * @see AnnotationType
23  */
24 public interface AnnotationTypeBuilder extends Type {
25
26     /**
27      * The method creates new AnnotationTypeBuilder containing specified
28      * package name an annotation name.
29      * <br>
30      * Neither the package name or annotation name can contain
31      * <code>null</code> references. In case that
32      * any of parameters contains <code>null</code> the method SHOULD thrown
33      * {@link IllegalArgumentException}
34      *
35      * @param packageName Package Name of Annotation Type
36      * @param name Name of Annotation Type
37      * @return <code>new</code> instance of Annotation Type Builder.
38      */
39     public AnnotationTypeBuilder addAnnotation(final String packageName, final String name);
40
41     /**
42      * Adds the parameter into List of parameters for Annotation Type.
43      * <br>
44      * If there is already stored parameter with the same name as the new
45      * parameter, the value of the old one will be simply overwritten by the
46      * newer parameter.
47      * <br>
48      * Neither the param name or value can contain
49      * <code>null</code> references. In case that
50      * any of parameters contains <code>null</code> the method SHOULD thrown
51      * {@link IllegalArgumentException}
52      *
53      * @param paramName Parameter Name
54      * @param value Parameter Value
55      * @return <code>true</code> if the parameter has been successfully
56      * assigned for Annotation Type
57      */
58     public boolean addParameter(final String paramName, String value);
59
60     /**
61      * Adds the parameter with specified List of parameter values into List of
62      * parameters for Annotation Type.
63      * <br>
64      * If there is already stored parameter with the same name as the new
65      * parameter, the value of the old one will be simply overwritten by the
66      * newer parameter.
67      * <br>
68      * Neither the param name or value can contain
69      * <code>null</code> references. In case that
70      * any of parameters contains <code>null</code> the method SHOULD thrown
71      * {@link IllegalArgumentException}
72      *
73      * @param paramName Parameter Name
74      * @param values List of Values bounded to Parameter Name
75      * @return <code>true</code> if the parameter has been successfully
76      * assigned for Annotation Type
77      */
78     public boolean addParameters(final String paramName, List<String> values);
79
80     /**
81      * Returns <code>new</code> <i>immutable</i> instance of Annotation Type
82      * with values assigned in current instance of Annotation Type Builder.
83      * <br>
84      * The return Annotation Type instance is immutable thus no additional
85      * modification to Annotation Type Builder will have an impact to
86      * instantiated Annotation Type.
87      * <br>
88      * For this purpose call this method after
89      * all additions are complete.
90      *
91      * @return <code>new</code> <i>immutable</i> instance of Annotation Type.
92      */
93     public AnnotationType toInstance();
94 }