java.lang.Object
com.graphql_java_generator.plugin.language.impl.AbstractType
com.graphql_java_generator.plugin.language.impl.ObjectType
All Implemented Interfaces:
Type
Direct Known Subclasses:
InterfaceType, UnionType

public class ObjectType extends AbstractType
This class describes one object type, as found in a graphql schema. It aims to be simple enough, so that the Velocity template can easily generated the fields from it.
An ObjectType would for instance describe:
 type Character {
   name: String!
   appearsIn: [Episode!]!
 }
 
Author:
etienne-sf
  • Constructor Details

    • ObjectType

      public ObjectType(String name, CommonConfiguration configuration, DocumentParser documentParser)
      Parameters:
      name - The name of this object type
      configuration - The current plugin configuration, which is accessible through an interface that extends CommonConfiguration
      documentParser - The DocumentParser that has parsed the schema, and so that contains the whole schema definition
    • ObjectType

      protected ObjectType(String name, Type.GraphQlType type, CommonConfiguration configuration, DocumentParser documentParser)
      This constructor is especially intended for subclasses, like InterfaceType
      Parameters:
      name - the name for this type
      type - the kind of object
      configuration - The current plugin configuration, which is accessible through an interface that extends CommonConfiguration
      documentParser - The DocumentParser that has parsed the schema, and so that contains the whole schema definition
  • Method Details

    • getPackageName

      public String getPackageName()
      Description copied from interface: Type
      Returns the package's name where the GraphQL objects from the GraphQL schema must be generated.
      Returns:
    • getIdentifier

      public Field getIdentifier()
      Description copied from interface: Type
      Returns the identifier for this type. Typically : the field which has an ID as a type.
      Returns:
      The identifier for this type, or null of this type has no identifier or multiplier identifers (that is: multiple identifiers or identifier based on several fields are not currently managed)
    • isCustomScalar

      public boolean isCustomScalar()
      Description copied from interface: Type
      Returns true if this type is a GraphQL Custom Scalar, false otherwise
    • isScalar

      public boolean isScalar()
      Description copied from interface: Type
      Returns true if this type is a GraphQL Scalar (custom or not), false otherwise
    • getRequestTypePascalCase

      public String getRequestTypePascalCase()
    • getPrefix

      protected String getPrefix()
      Overrides:
      getPrefix in class AbstractType
    • getSuffix

      protected String getSuffix()
      Overrides:
      getSuffix in class AbstractType
    • toString

      public String toString()
      Overrides:
      toString in class AbstractType
    • getImplementedTypes

      public List<ObjectType> getImplementedTypes()
      Returns the list of Types that this object implements. These types may interfaces or unions.
      Returns: