Class JavaStaticCodeBlock

java.lang.Object
com.github.tadukoo.java.code.staticcodeblock.JavaStaticCodeBlock
All Implemented Interfaces:
JavaCodeType, JavaTokens
Direct Known Subclasses:
EditableJavaStaticCodeBlock, UneditableJavaStaticCodeBlock

public abstract class JavaStaticCodeBlock extends Object implements JavaCodeType
Java Static Code Block represents a static code block in a Java class, etc.
Version:
Beta v.0.6
Author:
Logan Ferree (Tadukoo)
  • Field Details

    • lines

      protected List<String> lines
      The actual content of the static code block
  • Constructor Details

    • JavaStaticCodeBlock

      protected JavaStaticCodeBlock(boolean editable, List<String> lines)
      Constructs a new Static Code Block with the given parameters.
      Parameters:
      editable - Whether the static code block is editable or not
      lines - The actual content of the static code block
  • Method Details

    • getJavaCodeType

      public JavaCodeTypes getJavaCodeType()
      Specified by:
      getJavaCodeType in interface JavaCodeType
      Returns:
      What type this is
    • isEditable

      public boolean isEditable()
      Returns:
      Whether the static code block is editable or not
    • getLines

      public List<String> getLines()
      Returns:
      The actual content of the static code block
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      This Java Static Code Block as a String, ready to be put in some Java code
    • equals

      public boolean equals(Object otherStaticCodeBlock)
      Overrides:
      equals in class Object
    • toBuilderCode

      public String toBuilderCode()
      Specified by:
      toBuilderCode in interface JavaCodeType
      Returns:
      The String of code to build the JavaCodeType