Class FieldModel

  • All Implemented Interfaces:

    
    public final class FieldModel
    extends Record
                        

    Model representing a GraphQL field for code generation.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      FieldModel()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static FieldModel simple(String name, String javaType, boolean nullable) Creates a simple scalar FieldModel with no composite/enum/abstract type metadata.
      String getName()
      String getSafeName() Returns a Java-safe identifier name.
      String getJavaType()
      boolean getNullable()
      boolean getCompositeType() Returns whether this field's base type is a composite object or nested input type.
      boolean getList() Returns whether this field is a list type.
      boolean getEnumType() Returns whether this field's base type is an enum.
      boolean getAbstractType() Returns whether this field's base type is an interface or union (abstract composite type).
      String getBaseTypeName() Returns the simple class name of the base type (for composite and enum fields).
      boolean getCompositeList() Returns true if this is a list of composite objects.
      boolean getAbstractList() Returns true if this is a list of abstract composite types (interfaces/unions).
      boolean getEnumList() Returns true if this is a list of enums.
      boolean getScalarList() Returns true if this is a list of scalar values (not composites, not enums).
      String getScalarCoercionHint() Returns the GraphQL scalar type name for temporal types that need coercion at runtime, or null for non-temporal scalars.
      boolean getHasScalarCoercionHint() Returns true if this field needs temporal scalar coercion.
      boolean getTemporalScalar() Returns true if this is a non-list temporal scalar field needing coercion.
      boolean getTemporalScalarList() Returns true if this is a list of temporal scalar values needing coercion.
      String getGetterName() Returns the getter method name for this field.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FieldModel

        FieldModel()
    • Method Detail

      • simple

         static FieldModel simple(String name, String javaType, boolean nullable)

        Creates a simple scalar FieldModel with no composite/enum/abstract type metadata. Useful for tests and scalar fields.

      • getSafeName

         String getSafeName()

        Returns a Java-safe identifier name. If the field name is a Java reserved keyword or reserved identifier, appends _ to avoid compilation errors (e.g., double double_, ___).

      • getCompositeType

         boolean getCompositeType()

        Returns whether this field's base type is a composite object or nested input type.

      • getList

         boolean getList()

        Returns whether this field is a list type.

      • getEnumType

         boolean getEnumType()

        Returns whether this field's base type is an enum.

      • getAbstractType

         boolean getAbstractType()

        Returns whether this field's base type is an interface or union (abstract composite type).

      • getBaseTypeName

         String getBaseTypeName()

        Returns the simple class name of the base type (for composite and enum fields).

      • getCompositeList

         boolean getCompositeList()

        Returns true if this is a list of composite objects. Used for ST template conditionals.

      • getAbstractList

         boolean getAbstractList()

        Returns true if this is a list of abstract composite types (interfaces/unions). Used for ST template conditionals.

      • getEnumList

         boolean getEnumList()

        Returns true if this is a list of enums. Used for ST template conditionals.

      • getScalarList

         boolean getScalarList()

        Returns true if this is a list of scalar values (not composites, not enums). Used for ST template conditionals.

      • getScalarCoercionHint

         String getScalarCoercionHint()

        Returns the GraphQL scalar type name for temporal types that need coercion at runtime, or null for non-temporal scalars. Maps Java types back to their GraphQL scalar names: Instant → "DateTime", LocalDate → "Date", OffsetTime → "Time".

      • getHasScalarCoercionHint

         boolean getHasScalarCoercionHint()

        Returns true if this field needs temporal scalar coercion.

      • getTemporalScalar

         boolean getTemporalScalar()

        Returns true if this is a non-list temporal scalar field needing coercion.

      • getTemporalScalarList

         boolean getTemporalScalarList()

        Returns true if this is a list of temporal scalar values needing coercion.