Class JavaMethod

java.lang.Object
com.github.tadukoo.parsing.code.java.JavaMethod

public class JavaMethod extends Object
Java Method represents a method in a Java class or interface, etc.
Since:
Alpha v.0.2
Version:
Alpha v.0.3
Author:
Logan Ferree (Tadukoo)
  • Field Details

    • annotations

      private final List<JavaAnnotation> annotations
      The annotations on the method
    • visibility

      private final Visibility visibility
      The Visibility of the method
    • returnType

      private final String returnType
      The return type of the method
    • name

      private final String name
      The name of the method
    • parameters

      private final List<com.github.tadukoo.util.tuple.Pair<String,String>> parameters
      The parameters used in the method - pairs of type, then name
    • throwTypes

      private final List<String> throwTypes
      The types that can be thrown by the method
    • lines

      private final List<String> lines
      The actual lines of code in the method
  • Constructor Details

    • JavaMethod

      private JavaMethod(List<JavaAnnotation> annotations, Visibility visibility, String returnType, String name, List<com.github.tadukoo.util.tuple.Pair<String,String>> parameters, List<String> throwTypes, List<String> lines)
      Constructs a new Java Method with the given parameters
      Parameters:
      annotations - The annotations on the method
      visibility - The Visibility of the method
      returnType - The return type of the method
      name - The name of the method
      parameters - The parameters used in the method - pairs of type, then name
      throwTypes - The types that can be thrown by the method
      lines - The actual lines of code in the method
  • Method Details

    • builder

      public static JavaMethod.JavaMethodBuilder builder()
      Returns:
      A new JavaMethod.JavaMethodBuilder to use to build a JavaMethod
    • getAnnotations

      public List<JavaAnnotation> getAnnotations()
      Returns:
      The annotations on the method
    • getVisibility

      public Visibility getVisibility()
      Returns:
      The Visibility of the method
    • getReturnType

      public String getReturnType()
      Returns:
      The return type of the method
    • getName

      public String getName()
      Returns:
      The name of the method
    • getParameters

      public List<com.github.tadukoo.util.tuple.Pair<String,String>> getParameters()
      Returns:
      The parameters used in the method - pairs of type, then name
    • getThrowTypes

      public List<String> getThrowTypes()
      Returns:
      The types that can be thrown by the method
    • getLines

      public List<String> getLines()
      Returns:
      The actual lines of code in the method
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      This Java Method as a String, ready to be put in some Java code