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