Class Error

java.lang.Object
com.graphql_java_generator.client.response.Error

public class Error
extends java.lang.Object
The error POJO, mapped from the GraphQL server response, when an error occurs
Author:
etienne-sf
  • Field Summary

    Fields 
    Modifier and Type Field Description
    java.lang.String description  
    java.lang.String errorType  
    com.fasterxml.jackson.databind.JsonNode extensions
    The extensions field of errors, stored as is from the incoming GraphQL response.
    java.util.List<Location> locations  
    java.lang.String message  
    java.util.List<java.lang.String> path  
    java.util.List<java.lang.String> queryPath  
    java.lang.String validationErrorType  
  • Constructor Summary

    Constructors 
    Constructor Description
    Error()  
  • Method Summary

    Modifier and Type Method Description
    com.fasterxml.jackson.databind.JsonNode getExtensions()  
    java.util.Map<java.lang.String,​com.fasterxml.jackson.databind.JsonNode> getExtensionsAsMap()
    Returns the extensions as a map.
    java.util.Map<java.lang.String,​java.lang.String> getExtensionsAsMapStringString()
    Returns the extensions as a map.
    <T> T getExtensionsField​(java.lang.String key, java.lang.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.
    void setExtensions​(com.fasterxml.jackson.databind.JsonNode extensions)  
    java.lang.String toString()
    Logs this error to the given Logger

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • toString

      public java.lang.String toString()
      Logs this error to the given Logger
      Overrides:
      toString in class java.lang.Object
      Parameters:
      logger -
    • getExtensions

      public com.fasterxml.jackson.databind.JsonNode getExtensions()
    • setExtensions

      public void setExtensions​(com.fasterxml.jackson.databind.JsonNode extensions)
    • getExtensionsAsMap

      public java.util.Map<java.lang.String,​com.fasterxml.jackson.databind.JsonNode> getExtensionsAsMap()
      Returns the extensions as a map. The values can't be deserialized, as their type is unknown.
      Returns:
    • getExtensionsAsMapStringString

      public java.util.Map<java.lang.String,​java.lang.String> getExtensionsAsMapStringString()
      Returns the extensions as a map. The values can't be deserialized, as their type is unknown.
      Returns:
    • getExtensionsField

      public <T> T getExtensionsField​(java.lang.String key, java.lang.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