All Superinterfaces:
AnnotableTypeBuilder, TypeMemberBuilder<MethodSignatureBuilder>

public interface MethodSignatureBuilder extends TypeMemberBuilder<MethodSignatureBuilder>
Method Signature Builder serves solely for building Method Signature and returning the 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 Details

    • setAbstract

      MethodSignatureBuilder setAbstract(boolean isAbstract)
      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 MethodSignature.isAbstract() also equals to true.
      Parameters:
      isAbstract - is abstract flag
    • setDefault

      MethodSignatureBuilder setDefault(boolean isDefault)
      Sets the flag indicating whether this is a default interface method.
      Parameters:
      isDefault - true if this signature is to represent a default method.
      Returns:
      this builder
    • setMechanics

    • addParameter

      MethodSignatureBuilder addParameter(Type type, String name)
      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 IllegalArgumentException
      Parameters:
      type - Parameter Type
      name - Parameter Name
    • toInstance

      MethodSignature toInstance(Type definingType)
      Returns new immutable instance of Method Signature.
      The definingType param cannot be null. 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 IllegalArgumentException.
      Parameters:
      definingType - Defining Type of Method Signature
      Returns:
      new immutable instance of Method Signature.