Class JavaMethod

java.lang.Object
com.github.tadukoo.java.JavaMethod
Direct Known Subclasses:
EditableJavaMethod, UneditableJavaMethod

public abstract class JavaMethod extends Object
Java Method represents a method in a Java class or interface, etc.
Since:
Alpha v.0.2 (as old version that is now more like UneditableJavaMethod), Alpha v.0.4 (as newer version)
Version:
Alpha v.0.4
Author:
Logan Ferree (Tadukoo)
  • Field Details

    • sectionComment

      protected String sectionComment
      The section comment above the method
    • javadoc

      protected Javadoc javadoc
      The Javadoc on the method
    • annotations

      protected List<JavaAnnotation> annotations
      The annotations on the method
    • visibility

      protected Visibility visibility
      The Visibility of the method
    • isStatic

      protected boolean isStatic
      Whether the method is static or not
    • returnType

      protected String returnType
      The return type of the method
    • name

      protected String name
      The name of the method
    • parameters

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

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

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

    • JavaMethod

      protected JavaMethod(boolean editable, String sectionComment, Javadoc javadoc, List<JavaAnnotation> annotations, Visibility visibility, boolean isStatic, 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:
      editable - Whether the method is editable or not
      sectionComment - The section comment above the method
      javadoc - The Javadoc on the method
      annotations - The annotations on the method
      visibility - The Visibility of the method
      isStatic - Whether the method is static or not
      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

    • isEditable

      public boolean isEditable()
      Returns:
      Whether the method is editable or not
    • getSectionComment

      public String getSectionComment()
      Returns:
      The section comment above the method
    • getJavadoc

      public Javadoc getJavadoc()
      Returns:
      The Javadoc on the method
    • getAnnotations

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

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

      public boolean isStatic()
      Returns:
      Whether the method is static or not
    • 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
    • equals

      public boolean equals(Object otherMethod)
      Overrides:
      equals in class Object