Package org.forum.client
Class Subscription
java.lang.Object
org.forum.client.SubscriptionExecutorForum
org.forum.client.Subscription
- All Implemented Interfaces:
GraphQLRequestObject
,GraphQLSubscriptionExecutor
- Direct Known Subclasses:
SubscriptionResponse
This class contains the response for a full request. See the
plugin web site
for more information on full and partial requests.
It also allows access to the _extensions_ part of the response. Take a look at the GraphQL spec for more information on this.
It also allows access to the _extensions_ part of the response. Take a look at the GraphQL spec for more information on this.
- Author:
- generated by graphql-java-generator
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The Builder that helps building instance of this POJO. -
Field Summary
Modifier and TypeFieldDescriptionboolean
The field below is the only change from the original template. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Subscription.Builder
builder()
getAliasValue
(String alias) Retrieves the value for the given alias, as it has been received for this object in the GraphQL response.com.fasterxml.jackson.databind.JsonNode
Returns the extensions as a map.<T> T
getExtensionsField
(String key, Class<T> t) Parse the value for the given _key_, as found in the extensions field of the GraphQL server's response, into the given _t_ class.getSubscribeToNewPostGraphQLRequest
(String partialRequest) Deprecated.Deprecated.void
set__typename
(String __typename) void
setAliasValue
(String aliasName, Object aliasDeserializedValue) This method is called during the json deserialization process, by theGraphQLObjectMapper
, each time an alias value is read from the json.void
setExtensions
(com.fasterxml.jackson.databind.JsonNode extensions) void
setSubscribeToNewPost
(Post subscribeToNewPost) subscribeToNewPost
(ObjectResponse objectResponse, SubscriptionCallback<Post> subscriptionCallback, String boardName, Object... paramsAndValues) Deprecated.subscribeToNewPost
(String queryResponseDef, SubscriptionCallback<Post> subscriptionCallback, String boardName, Object... paramsAndValues) Deprecated.subscribeToNewPostWithBindValues
(ObjectResponse objectResponse, SubscriptionCallback<Post> subscriptionCallback, String boardName, Map<String, Object> parameters) Deprecated.subscribeToNewPostWithBindValues
(String queryResponseDef, SubscriptionCallback<Post> subscriptionCallback, String boardName, Map<String, Object> parameters) Deprecated.toString()
Methods inherited from class org.forum.client.SubscriptionExecutorForum
exec, exec, execWithBindValues, execWithBindValues, getGraphQLRequest, getResponseBuilder
-
Field Details
-
thisIsADummyFieldToCheckThatThisTemplateIsUsed
public boolean thisIsADummyFieldToCheckThatThisTemplateIsUsedThe field below is the only change from the original template. It is here only to check that this template is actually used
-
-
Constructor Details
-
Subscription
public Subscription()
-
-
Method Details
-
setSubscribeToNewPost
-
getSubscribeToNewPost
-
set__typename
-
get__typename
-
setAliasValue
This method is called during the json deserialization process, by theGraphQLObjectMapper
, each time an alias value is read from the json.- Parameters:
aliasName
-aliasDeserializedValue
-
-
getAliasValue
Retrieves the value for the given alias, as it has been received for this object in the GraphQL response.
This method should not be used for Custom Scalars, as the parser doesn't know if this alias is a custom scalar, and which custom scalar to use at deserialization time. In most case, a value will then be provided by this method with a basis json deserialization, but this value won't be the proper custom scalar value.- Parameters:
alias
-- Returns:
-
toString
-
builder
-
getExtensions
public com.fasterxml.jackson.databind.JsonNode getExtensions() -
setExtensions
public void setExtensions(com.fasterxml.jackson.databind.JsonNode extensions) - Specified by:
setExtensions
in interfaceGraphQLRequestObject
-
getExtensionsAsMap
Returns the extensions as a map. The values can't be deserialized, as their type is unknown.- Returns:
-
getExtensionsField
public <T> T getExtensionsField(String key, Class<T> t) throws com.fasterxml.jackson.core.JsonProcessingException Parse the value for the given _key_, as found in the extensions field of the GraphQL server's response, into the given _t_ class.- Type Parameters:
T
-- Parameters:
key
-t
-- Returns:
- null if the key is not in the extensions map. Otherwise: the value for this _key_, as a _t_ instance
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
- When there is an error when converting the key's value into the _t_ class
-
subscribeToNewPostWithBindValues
@Deprecated public SubscriptionClient subscribeToNewPostWithBindValues(String queryResponseDef, SubscriptionCallback<Post> subscriptionCallback, String boardName, Map<String, Object> parameters) throws GraphQLRequestExecutionException, GraphQLRequestPreparationExceptionDeprecated.This method is deprecated: please useSubscriptionExecutor
class instead of this class, to execute this method. It is maintained to keep existing code compatible with the generated code. It will be removed in 2.0 version.- Overrides:
subscribeToNewPostWithBindValues
in classSubscriptionExecutorForum
- Parameters:
queryResponseDef
- The response definition of the subscription, in the native GraphQL format (see here above)subscriptionCallback
- The instance that will be called for each notification (message or error) received for this subscription.
It's an instance ofSubscriptionCallback
<clazz>, whereclazz
is the subscribeToNewPost subscription field.boardName
- Parameter for the subscribeToNewPost field of Subscription, as defined in the GraphQL schemaparameters
- The list of values, for the bind variables defined in the subscription. If there is no bind variable in the defined subscription, this argument may be null or an emptyMap
- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsedGraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
-
subscribeToNewPost
@Deprecated public SubscriptionClient subscribeToNewPost(String queryResponseDef, SubscriptionCallback<Post> subscriptionCallback, String boardName, Object... paramsAndValues) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException Deprecated.This method is deprecated: please useSubscriptionExecutor
class instead of this class, to execute this method. It is maintained to keep existing code compatible with the generated code. It will be removed in 2.0 version.- Overrides:
subscribeToNewPost
in classSubscriptionExecutorForum
- Parameters:
queryResponseDef
- The response definition of the subscription, in the native GraphQL format (see here above)subscriptionCallback
- The instance that will be called for each notification (message or error) received for this subscription.
It's an instance ofSubscriptionCallback
<clazz>, whereclazz
is the subscribeToNewPost subscription field.boardName
- Parameter for the subscribeToNewPost field of Subscription, as defined in the GraphQL schema- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsedGraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
-
subscribeToNewPostWithBindValues
@Deprecated public SubscriptionClient subscribeToNewPostWithBindValues(ObjectResponse objectResponse, SubscriptionCallback<Post> subscriptionCallback, String boardName, Map<String, Object> parameters) throws GraphQLRequestExecutionExceptionDeprecated.This method is deprecated: please useSubscriptionExecutor
class instead of this class, to execute this method. It is maintained to keep existing code compatible with the generated code. It will be removed in 2.0 version.- Overrides:
subscribeToNewPostWithBindValues
in classSubscriptionExecutorForum
- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to return
Note: theObjectResponse
type of this parameter is defined for backward compatibility. In new implementations, the expected type is the generated GraphQLRequestForum POJO, as returned by theSubscriptionExecutorForum.getSubscribeToNewPostGraphQLRequest(java.lang.String)
method.subscriptionCallback
- The instance that will be called for each notification (message or error) received for this subscription.
It's an instance ofSubscriptionCallback
<clazz>, whereclazz
is the subscribeToNewPost subscription field.boardName
- Parameter for the subscribeToNewPost field of Subscription, as defined in the GraphQL schemaparameters
- The list of values, for the bind variables defined in the subscription. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
subscribeToNewPost
@Deprecated public SubscriptionClient subscribeToNewPost(ObjectResponse objectResponse, SubscriptionCallback<Post> subscriptionCallback, String boardName, Object... paramsAndValues) throws GraphQLRequestExecutionException Deprecated.This method is deprecated: please useSubscriptionExecutor
class instead of this class, to execute this method. It is maintained to keep existing code compatible with the generated code. It will be removed in 2.0 version.- Overrides:
subscribeToNewPost
in classSubscriptionExecutorForum
- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to return
Note: theObjectResponse
type of this parameter is defined for backward compatibility. In new implementations, the expected type is the generated GraphQLRequestForum POJO, as returned by theSubscriptionExecutorForum.getSubscribeToNewPostGraphQLRequest(java.lang.String)
method.subscriptionCallback
- The instance that will be called for each notification (message or error) received for this subscription.
It's an instance ofSubscriptionCallback
<clazz>, whereclazz
is the subscribeToNewPost subscription field.boardName
- Parameter for the subscribeToNewPost field of Subscription, as defined in the GraphQL schemaparamsAndValues
- This parameter contains all the name and values for the Bind Variables defined in the objectResponse parameter, that must be sent to the server. Optional parameter may not have a value. They will be ignored and not sent to the server. Mandatory parameter must be provided in this argument.
This parameter contains an even number of parameters. It must be a series of name and values, like : paramName1, paramValue1, paramName2, paramValue2...- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
getSubscribeToNewPostResponseBuilder
@Deprecated public Builder getSubscribeToNewPostResponseBuilder() throws GraphQLRequestPreparationExceptionDeprecated.This method is deprecated: please useSubscriptionExecutor
class instead of this class, to execute this method. It is maintained to keep existing code compatible with the generated code. It will be removed in 2.0 version.- Overrides:
getSubscribeToNewPostResponseBuilder
in classSubscriptionExecutorForum
- Returns:
- Throws:
GraphQLRequestPreparationException
-
getSubscribeToNewPostGraphQLRequest
@Deprecated public GraphQLRequestForum getSubscribeToNewPostGraphQLRequest(String partialRequest) throws GraphQLRequestPreparationException Deprecated.This method is deprecated: please useSubscriptionExecutor
class instead of this class, to execute this method. It is maintained to keep existing code compatible with the generated code. It will be removed in 2.0 version.- Overrides:
getSubscribeToNewPostGraphQLRequest
in classSubscriptionExecutorForum
- Parameters:
partialRequest
- The Partial GraphQL request, as explained in the plugin client documentation- Returns:
- Throws:
GraphQLRequestPreparationException
-