Package net.morimekta.providence.graphql
Interface GQLFieldProvider<Message extends PMessage<Message>>
-
- Type Parameters:
Message
- The message type.
- All Known Implementing Classes:
FieldFieldProvider
,InputValueFieldProvider
,TypeFieldProvider
public interface GQLFieldProvider<Message extends PMessage<Message>>
Interface for functionality that provide field values based on a source message and a GQL field.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PMessageDescriptor<Message>
getDescriptor()
Get the type descriptor this mutator is for.java.util.Collection<PField<Message>>
getFields()
Get the set of fields that can be mutated with this mutator.java.lang.Object
provide(Message message, PField<Message> field, GQLField selection)
Mutate the message according to the field selection.
-
-
-
Method Detail
-
getDescriptor
PMessageDescriptor<Message> getDescriptor()
Get the type descriptor this mutator is for. This may be an interface type. Only used for error messages. This type must be indicative of the fields accepted by the provider.- Returns:
- The message type being mutated.
-
getFields
@Nonnull java.util.Collection<PField<Message>> getFields()
Get the set of fields that can be mutated with this mutator.- Returns:
- Collection of mutating fields.
-
provide
java.lang.Object provide(@Nonnull Message message, @Nonnull PField<Message> field, @Nonnull GQLField selection)
Mutate the message according to the field selection. The field selection will represent a single field in the base message, and will be called for each requested field.- Parameters:
message
- The base message builder to be mutated.field
- The source field requested.selection
- The field selection to be filled or changed.- Returns:
- The mutated value for the field.
-
-