Class GQLMethodCall
- java.lang.Object
-
- net.morimekta.providence.graphql.gql.GQLMethodCall
-
- All Implemented Interfaces:
GQLSelection
@Immutable public class GQLMethodCall extends java.lang.Object implements GQLSelection
Representation of a method call in an operation. This is distinct from a field request, as this level the call and response is ultimately required, where as the fields are added per availability. It also represents the call to an actual service which will provide the response to be returned for the named JSON field.
-
-
Constructor Summary
Constructors Constructor Description GQLMethodCall(PServiceMethod method, java.lang.String alias, PMessage<?> arguments, java.util.List<GQLSelection> selectionSet)
Make a full field selection definition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
getAlias()
<M extends PMessage<M>>
MgetArguments()
PServiceMethod
getMethod()
java.util.List<GQLSelection>
getSelectionSet()
int
hashCode()
java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.morimekta.providence.graphql.gql.GQLSelection
getSelection, hasSelection, hasSelectionPath
-
-
-
-
Constructor Detail
-
GQLMethodCall
public GQLMethodCall(@Nonnull PServiceMethod method, @Nullable java.lang.String alias, @Nullable PMessage<?> arguments, @Nullable java.util.List<GQLSelection> selectionSet)
Make a full field selection definition.- Parameters:
method
- The method call to be represented.alias
- The alias to be used in the JSON output.arguments
- Arguments used for the method call.selectionSet
- SelectionSet for sub-field selection.
-
-
Method Detail
-
getAlias
@Nullable public java.lang.String getAlias()
- Returns:
- The output field alias.
-
getMethod
@Nonnull public PServiceMethod getMethod()
- Returns:
- The method to be called to get field value. If message field null.
-
getArguments
@Nullable public <M extends PMessage<M>> M getArguments()
- Type Parameters:
M
- The argument message type.- Returns:
- The argument struct. If no arguments or params then null.
-
getSelectionSet
@Nullable public java.util.List<GQLSelection> getSelectionSet()
- Specified by:
getSelectionSet
in interfaceGQLSelection
- Returns:
- The field's selection set, or null if none.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-