T
- the type of the implementing classpublic class GraphQLRequest<T extends GraphQLRequest<T>> extends java.lang.Object implements VariableHolder<T>
Constructor and Description |
---|
GraphQLRequest(java.util.Map<java.lang.String,java.lang.Object> variables,
java.lang.String namespace)
Constructs a request with the passed variable mapping and namespace.
|
GraphQLRequest(java.lang.String namespace)
Constructs a request with the specified namespace and no predefined variables.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getNamespace() |
java.util.Map<java.lang.String,java.lang.Object> |
getVariables()
Gets the mapping of parameter keys and their values.
|
boolean |
isSet(java.lang.String key)
Determines if a variable exists for the specified key.
|
T |
set(@NonNull java.lang.String key,
java.lang.Object value)
Sets a variable.
|
public GraphQLRequest(java.lang.String namespace)
namespace
- the request namespacepublic GraphQLRequest(java.util.Map<java.lang.String,java.lang.Object> variables, java.lang.String namespace)
variables
- the mapping of variable keys and valuesnamespace
- the request namespacepublic T set(@NonNull @NonNull java.lang.String key, java.lang.Object value)
set
in interface VariableHolder<T extends GraphQLRequest<T>>
key
- the keyvalue
- the valuejava.lang.NullPointerException
- if key is nulljava.lang.IllegalArgumentException
- if key is emptypublic boolean isSet(java.lang.String key)
VariableHolder
isSet
in interface VariableHolder<T extends GraphQLRequest<T>>
key
- the keypublic java.util.Map<java.lang.String,java.lang.Object> getVariables()
VariableHolder
getVariables
in interface VariableHolder<T extends GraphQLRequest<T>>
public java.lang.String getNamespace()