2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.sal.binding.model.api.type.builder;
10 import java.util.List;
12 import org.opendaylight.controller.sal.binding.model.api.AnnotationType;
13 import org.opendaylight.controller.sal.binding.model.api.Type;
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.
24 public interface AnnotationTypeBuilder extends Type {
27 * The method creates new AnnotationTypeBuilder containing specified
28 * package name an annotation name.
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}
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.
39 public AnnotationTypeBuilder addAnnotation(final String packageName, final String name);
42 * Adds the parameter into List of parameters for Annotation Type.
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
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}
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
58 public boolean addParameter(final String paramName, String value);
61 * Adds the parameter with specified List of parameter values into List of
62 * parameters for Annotation Type.
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
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}
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
78 public boolean addParameters(final String paramName, List<String> values);
81 * Returns <code>new</code> <i>immutable</i> instance of Annotation Type
82 * with values assigned in current instance of Annotation Type Builder.
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.
88 * For this purpose call this method after
89 * all additions are complete.
91 * @return <code>new</code> <i>immutable</i> instance of Annotation Type.
93 public AnnotationType toInstance();