2 * Copyright (c) 2018 Pantheon Technologies, s.r.o. 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.mdsal.binding.model.api.type.builder;
10 import com.google.common.annotations.Beta;
11 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
14 * Common interface for java type builders which allow attaching annotations to them.
17 public interface AnnotableTypeBuilder {
19 * The method creates new {@link AnnotationTypeBuilder} containing specified package name an annotation name.
21 * @param identifier JavaTypeName of the annotation
22 * @return a new instance of Annotation Type Builder.
24 AnnotationTypeBuilder addAnnotation(JavaTypeName identifier);
27 * The method creates new {@link AnnotationTypeBuilder} containing specified package name an annotation name.
28 * Neither the package name or annotation name can contain <code>null</code> references. In case that any
29 * of parameters contains <code>null</code> the method SHOULD thrown {@link IllegalArgumentException}
31 * @param packageName Package Name of Annotation Type
32 * @param simpleName Name of Annotation Type
33 * @return <code>new</code> instance of Annotation Type Builder.
34 * @throws NullPointerException if any of the arguments are null
35 * @throws IllegalArgumentException if any of the arguments is an empty string
37 default AnnotationTypeBuilder addAnnotation(final String packageName, final String simpleName) {
38 return addAnnotation(JavaTypeName.create(packageName, simpleName));