Class GenerationSourceField<T extends graphql.language.NamedNode<T> & graphql.language.DirectivesContainer<T>>
java.lang.Object
no.sikt.graphitron.definitions.fields.AbstractField<T>
no.sikt.graphitron.definitions.fields.GenerationSourceField<T>
- All Implemented Interfaces:
FieldSpecification,GenerationField,GenerationTarget
- Direct Known Subclasses:
InputField,ObjectField
public abstract class GenerationSourceField<T extends graphql.language.NamedNode<T> & graphql.language.DirectivesContainer<T>>
extends AbstractField<T>
implements GenerationField
This class represents the general functionality associated with GraphQLs fields that can initialise code generation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleangetJavaRecordMethodMapping(boolean mapsJavaRecord) Get the method mapping for Java record field access.booleanbooleanbooleaninthashCode()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanDoes this have theGenerationDirective.NOT_GENERATEDdirective for skipping generation set?booleanbooleanbooleanvoidMark this field as an implicit split query, giving it the same behavior as an explicit@splitQuerydirective.Methods inherited from class no.sikt.graphitron.definitions.fields.AbstractField
formatGraphQLSchemaType, getContainerTypeName, getJavaName, getMappingFromFieldOverride, getMappingFromSchemaName, getName, getTypeClass, getTypeName, getUnprocessedFieldOverrideInput, getUpperCaseName, hasSetFieldOverride, isID, isIterableWrapped, isIterableWrappedWithNullableElement, isNonNullable, isNullable, isRootFieldMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface no.sikt.graphitron.definitions.interfaces.FieldSpecification
getContainerTypeName, getMappingFromFieldOverride, getMappingFromSchemaName, getName, getTypeClass, getTypeName, getUpperCaseName, hasSetFieldOverride, isID, isIterableWrapped, isIterableWrappedWithNullableElement, isNonNullable, isNullable, isRootFieldMethods inherited from interface no.sikt.graphitron.definitions.interfaces.GenerationField
isInputMethods inherited from interface no.sikt.graphitron.definitions.interfaces.GenerationTarget
createsDataFetchersForFields
-
Constructor Details
-
GenerationSourceField
-
-
Method Details
-
createsDataFetcher
public boolean createsDataFetcher()- Specified by:
createsDataFetcherin interfaceGenerationTarget- Returns:
- Does this element lead to the generation of additional data fetchers?
-
isExternalField
public boolean isExternalField()- Specified by:
isExternalFieldin interfaceGenerationField
-
hasFieldDirective
public boolean hasFieldDirective()- Specified by:
hasFieldDirectivein interfaceGenerationField
-
getMappingForRecordFieldOverride
- Specified by:
getMappingForRecordFieldOverridein interfaceGenerationField- Returns:
- Record-side method mapping based on the name of the field or the directive
GenerationDirective.FIELDset on this type.
-
getJavaRecordMethodMapping
Get the method mapping for Java record field access.- Specified by:
getJavaRecordMethodMappingin interfaceGenerationField- Parameters:
mapsJavaRecord- true for types with @record directive (uses raw @field name), false otherwise (uses toCamelCase)- Returns:
- The appropriate MethodMapping for getter/setter generation
-
getFieldRecordMappingName
- Specified by:
getFieldRecordMappingNamein interfaceGenerationField- Returns:
- Record-side name mapping based on the name of the field or the
GenerationDirective.FIELDdirective set on this type.
-
getFieldReferences
- Specified by:
getFieldReferencesin interfaceGenerationField
-
hasFieldReferences
public boolean hasFieldReferences()- Specified by:
hasFieldReferencesin interfaceGenerationField
-
getMultitableReferences
-
hasMultitableReferences
public boolean hasMultitableReferences() -
getCondition
- Specified by:
getConditionin interfaceGenerationField
-
hasCondition
public boolean hasCondition()- Specified by:
hasConditionin interfaceGenerationField
-
hasOverridingCondition
public boolean hasOverridingCondition()- Specified by:
hasOverridingConditionin interfaceGenerationField
-
isGenerated
public boolean isGenerated()- Specified by:
isGeneratedin interfaceGenerationTarget- Returns:
- Should this object be generated?
-
hasServiceReference
public boolean hasServiceReference()- Specified by:
hasServiceReferencein interfaceGenerationField- Returns:
- Does this field have a service reference defined?
-
getExternalMethod
- Specified by:
getExternalMethodin interfaceGenerationField- Returns:
- The wrapper object for a service reference, if the field has a service set. Otherwise, null.
-
getContextFields
- Specified by:
getContextFieldsin interfaceGenerationField- Returns:
- Get any context fields related to this field. This may be either service or condition context fields (without duplicates).
-
hasMutationType
public boolean hasMutationType()- Specified by:
hasMutationTypein interfaceGenerationField- Returns:
- Does this field have a mutation operation defined?
-
getMutationType
- Specified by:
getMutationTypein interfaceGenerationField- Returns:
- The type of mutation that should be applied in this operation.
-
isGeneratedWithResolver
public boolean isGeneratedWithResolver()- Specified by:
isGeneratedWithResolverin interfaceGenerationTarget- Returns:
- Should this object be generated as or containing resolvers?
-
markAsImplicitSplitQuery
public void markAsImplicitSplitQuery()Mark this field as an implicit split query, giving it the same behavior as an explicit@splitQuerydirective. -
hasImplicitSplitQuery
public boolean hasImplicitSplitQuery() -
isExplicitlyNotGenerated
public boolean isExplicitlyNotGenerated()Description copied from interface:GenerationTargetDoes this have theGenerationDirective.NOT_GENERATEDdirective for skipping generation set?- Specified by:
isExplicitlyNotGeneratedin interfaceGenerationTarget
-
hasNodeID
public boolean hasNodeID()- Specified by:
hasNodeIDin interfaceFieldSpecification- Returns:
- Does this field have the @nodeId directive?
-
getNodeIdTypeName
- Specified by:
getNodeIdTypeNamein interfaceFieldSpecification- Returns:
- The type name configured in the @nodeId directive
-
hasTableMethodDirective
public boolean hasTableMethodDirective()- Specified by:
hasTableMethodDirectivein interfaceGenerationField
-
formatPath
- Specified by:
formatPathin interfaceGenerationField
-
equals
-
hashCode
public int hashCode()
-