Class JavaField

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

public class JavaField extends Object
Java Field represents a field in a Java class
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 field
    • visibility

      private final Visibility visibility
      The Visibility of the field
    • isFinal

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

      private final String type
      The type of the field
    • name

      private final String name
      The name of the field
    • value

      private final String value
      The value assigned to the field
  • Constructor Details

    • JavaField

      private JavaField(List<JavaAnnotation> annotations, Visibility visibility, boolean isFinal, String type, String name, String value)
      Constructs a Java Field with the given parameters
      Parameters:
      annotations - The annotations on the field
      visibility - The Visibility of the field
      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

    • builder

      public static JavaField.JavaFieldBuilder builder()
      Returns:
      A new JavaField.JavaFieldBuilder to create a new JavaField
    • getAnnotations

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

      public Visibility getVisibility()
      Returns:
      The Visibility of the field
    • 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 annotations on newlines above