Interface MethodSignatureBuilder
- All Superinterfaces:
AnnotableTypeBuilder,TypeMemberBuilder<MethodSignatureBuilder>
Method Signature Builder serves solely for building Method Signature and
returning the
By definition of
The methods as
new instance of Method Signature. By definition of
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
AnnotableTypeBuilder.addAnnotation(String, String) and
TypeMemberBuilder.setComment(TypeMemberComment) can be used as optional because not all methods
MUST contain annotation or comment definitions.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddParameter(Type type, String name) Adds Parameter into the List of method parameters.setAbstract(boolean isAbstract) Sets the flag for declaration of method as abstract or non abstract.setDefault(boolean isDefault) Sets the flag indicating whether this is adefault interfacemethod.setMechanics(MethodSignature.ValueMechanics mechanics) toInstance(Type definingType) Returnsnewimmutable instance of Method Signature.Methods inherited from interface org.opendaylight.mdsal.binding.model.api.type.builder.AnnotableTypeBuilder
addAnnotation, addAnnotationMethods inherited from interface org.opendaylight.mdsal.binding.model.api.type.builder.TypeMemberBuilder
getAccessModifier, getName, setAccessModifier, setComment, setFinal, setReturnType, setStatic
-
Method Details
-
setAbstract
Sets the flag for declaration of method as abstract or non abstract. If the flagisAbstract == truethe instantiated Method Signature MUST have return value forMethodSignature.isAbstract()also equals totrue.- Parameters:
isAbstract- is abstract flag
-
setDefault
Sets the flag indicating whether this is adefault interfacemethod.- Parameters:
isDefault- true if this signature is to represent a default method.- Returns:
- this builder
-
setMechanics
-
addParameter
Adds Parameter into the List of method parameters. Neither the Name or Type of parameter can benull.
In case that any of parameters are defined asnullthe method SHOULD throw anIllegalArgumentException- Parameters:
type- Parameter Typename- Parameter Name
-
toInstance
Returnsnewimmutable instance of Method Signature.
ThedefiningTypeparam cannot benull. Every method in Java MUST be declared and defined inside the scope ofclassorinterfacedefinition. In case that defining Type will be passed asnullreference the method SHOULD thrownIllegalArgumentException.- Parameters:
definingType- Defining Type of Method Signature- Returns:
newimmutable instance of Method Signature.
-