Class JavaField

java.lang.Object
com.github.tadukoo.java.JavaField
Direct Known Subclasses:
EditableJavaField, UneditableJavaField

public abstract class JavaField extends Object
Java Field represents a field in a Java class
Since:
Alpha v.0.2 (as old version that is now more like UneditableJavaField), 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 field
    • javadoc

      protected Javadoc javadoc
      The Javadoc on the field
    • annotations

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

      protected Visibility visibility
      The Visibility of the field
    • isStatic

      protected boolean isStatic
      Whether the field is static or not
    • isFinal

      protected boolean isFinal
      Whether the field is final or not
    • type

      protected String type
      The type of the field
    • name

      protected String name
      The name of the field
    • value

      protected String value
      The value assigned to the field
  • Constructor Details

    • JavaField

      protected JavaField(boolean editable, String sectionComment, Javadoc javadoc, List<JavaAnnotation> annotations, Visibility visibility, boolean isStatic, boolean isFinal, String type, String name, String value)
      Constructs a Java Field with the given parameters
      Parameters:
      editable - Whether the field is editable or not
      sectionComment - The section comment above the field
      javadoc - The Javadoc on the field
      annotations - The annotations on the field
      visibility - The Visibility of the field
      isStatic - Whether the field is static or not
      isFinal - Whether the field is final or not
      type - The type of the field
      name - The name of the field
      value - The value assigned to the field
  • Method Details

    • isEditable

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

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

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

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

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

      public boolean isStatic()
      Returns:
      Whether the field is static or not
    • isFinal

      public boolean isFinal()
      Returns:
      Whether the field is final or not
    • getType

      public String getType()
      Returns:
      The type of the field
    • getName

      public String getName()
      Returns:
      The name of the field
    • getValue

      public String getValue()
      Returns:
      The value assigned to the field
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      A string of the form "{visibility.getText()} {type} {name}", with javadoc and annotations on newlines above
    • equals

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