Class JavaAnnotation

java.lang.Object
com.github.tadukoo.java.annotation.JavaAnnotation
All Implemented Interfaces:
JavaCodeType, JavaTokens
Direct Known Subclasses:
EditableJavaAnnotation, UneditableJavaAnnotation

public abstract class JavaAnnotation extends Object implements JavaCodeType
Represents an annotation in Java.
Since:
Alpha v.0.3 (as old version that is now more like UneditableJavaAnnotation), Alpha v.0.4 (as newer version)
Version:
Beta v.0.5
Author:
Logan Ferree (Tadukoo)
  • Field Details

    • name

      protected String name
      The name of the annotation
    • canonicalName

      protected String canonicalName
      The canonical name of the annotation
    • parameters

      protected List<com.github.tadukoo.util.tuple.Pair<String,String>> parameters
      The parameters of the annotation (as Pairs of name and value)
  • Constructor Details

    • JavaAnnotation

      protected JavaAnnotation(boolean editable, String name, String canonicalName, List<com.github.tadukoo.util.tuple.Pair<String,String>> parameters)
      Constructs a new JavaAnnotation with the given parameters
      Parameters:
      editable - Whether the annotation is editable or not
      name - The name of the annotation
      canonicalName - The canonical name of the annotation
      parameters - The parameters of the annotation (as Pairs of name and value)
  • Method Details

    • getJavaCodeType

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

      public boolean isEditable()
      Returns:
      Whether the annotation is editable or not
    • getName

      public String getName()
      Returns:
      The name of the annotation
    • getCanonicalName

      public String getCanonicalName()
      Returns:
      The canonical name of the annotation
    • getParameters

      public List<com.github.tadukoo.util.tuple.Pair<String,String>> getParameters()
      Returns:
      The parameters of the annotation (as Pairs of name and value)
    • getParametersMap

      public Map<String,String> getParametersMap()
      Returns:
      The parameters of the annotation as a Map of parameter name to value
    • toString

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

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

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