X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fsal%2Fyang-prototype%2Fcode-generator%2Fbinding-model-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fmodel%2Fapi%2Ftype%2Fbuilder%2FMethodSignatureBuilder.java;h=70ea9bbb00491e074bef6b4216577006dc444e9c;hp=572d15faf4bee363e2c276cfd59b4788d5ce860e;hb=97d2f10bea5bdd773453bc7202b9dd04f4b70c3b;hpb=4221068644c7e8d08880b4d54e2a099a646796b9 diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/builder/MethodSignatureBuilder.java b/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/builder/MethodSignatureBuilder.java index 572d15faf4..70ea9bbb00 100644 --- a/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/builder/MethodSignatureBuilder.java +++ b/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/builder/MethodSignatureBuilder.java @@ -11,15 +11,58 @@ package org.opendaylight.controller.sal.binding.model.api.type.builder; import org.opendaylight.controller.sal.binding.model.api.MethodSignature; import org.opendaylight.controller.sal.binding.model.api.Type; -public interface MethodSignatureBuilder { - - public AnnotationTypeBuilder addAnnotation(final String packageName, final String name); - - public void addReturnType(final Type returnType); +/** + * Method Signature Builder serves solely for building Method Signature and + * returning the new instance of Method Signature. + *
+ * By definition of {@link MethodSignature} the Method in java MUST contain + * Name, Return Type and Access Modifier. By default the Access Modifier can + * be set to public. The Method Signature builder does not contain method for + * addName due to enforce reason that MethodSignatureBuilder SHOULD be + * instantiated only once with defined method name. + *
+ * The methods as {@link #addAnnotation(String, String)} and {@link #setComment(String)} + * can be used as optional because not all methods MUST contain annotation or + * comment definitions. + * + * + * @see MethodSignature + */ +public interface MethodSignatureBuilder extends TypeMemberBuilder { - public void addParameter(final Type type, final String name); + /** + * Sets the flag for declaration of method as abstract or non abstract. If the flag isAbstract == true + * The instantiated Method Signature MUST have return value for {@link org.opendaylight.controller.sal.binding + * .model.api.MethodSignature#isAbstract()} also equals to true. + * + * @param isAbstract is abstract flag + */ + public void setAbstract(boolean isAbstract); - public void addComment(final String comment); + /** + * Adds Parameter into the List of method parameters. Neither the Name or + * Type of parameter can be null. + * + *
+ * In case that any of parameters are defined as null the + * method SHOULD throw an {@link IllegalArgumentException} + * + * @param type Parameter Type + * @param name Parameter Name + */ + public void addParameter(final Type type, final String name); + /** + * Returns new immutable instance of Method Signature. + *
+ * The definingType param cannot be null. The + * every method in Java MUST be declared and defined inside the scope of + * class or interface definition. In case that + * defining Type will be passed as null reference the method + * SHOULD thrown {@link IllegalArgumentException}. + * + * @param definingType Defining Type of Method Signature + * @return new immutable instance of Method Signature. + */ public MethodSignature toInstance(final Type definingType); }