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