java.lang.Object
com.graphql_java_generator.plugin.language.impl.FieldImpl
All Implemented Interfaces:
Field

public class FieldImpl extends Object implements Field
Author:
etienne-sf
  • Constructor Details

    • FieldImpl

      public FieldImpl()
  • Method Details

    • getType

      public Type getType()
      Description copied from interface: Field
      Retrieves the Type for this field
      Specified by:
      getType in interface Field
      Returns:
    • getAnnotation

      public String getAnnotation()
      Description copied from interface: Field
      Retrieves the annotation or annotations to add to this field, when in server mode, to serve the relation that this field holds
      Specified by:
      getAnnotation in interface Field
      Returns:
      The relevant annotation(s) ready to add directly as-is in the Velocity template, or "" (an empty string) if there is no annotation to add. The return is never null.
    • isId

      public boolean isId()
      Description copied from interface: Field
      Indicates whether this field is an id or not. It's used in server mode to add the javax.persistence annotations for the id fields. Default value is false. This field is set to true for GraphQL fields which are of 'ID' type.
      Specified by:
      isId in interface Field
    • setAnnotation

      @Deprecated public void setAnnotation(String annotation)
      Deprecated.
      The annotation setter should be used. Please use the {@link #addAnnotation(String))} instead
      Parameters:
      annotation - The annotation, that will replace the current one
    • addAnnotation

      public void addAnnotation(String annotationToAdd)
      The annotation setter should be added. This method allows to properly manage indentation in the generated source code
      Parameters:
      annotationToAdd - The annotation, that will be added to the current one
    • addAnnotation

      public void addAnnotation(String annotationToAdd, boolean replace)
      The annotation setter should be added. This method allows to properly manage indentation in the generated source code
      Parameters:
      annotationToAdd - The annotation, that will be added to the current one
      replace - if true, any existing annotation is first removed
    • getPascalCaseName

      public String getPascalCaseName()
      Description copied from interface: Field
      Convert the given name, which is supposed to be in camel case (for instance: thisIsCamelCase) to a pascal case string (for instance: ThisIsCamelCase).
      Specified by:
      getPascalCaseName in interface Field
      Returns:
    • setComments

      public void setComments(List<graphql.language.Comment> comments)
    • toString

      public String toString()
      Overrides:
      toString in class Object