Class NativeResponseHandler

java.lang.Object
com.microsoft.kiota.NativeResponseHandler
All Implemented Interfaces:
ResponseHandler

public class NativeResponseHandler extends Object implements ResponseHandler
The ResponseHandler implementation to handle native response objects
  • Constructor Details

    • NativeResponseHandler

      public NativeResponseHandler()
      Default constructor
  • Method Details

    • handleResponse

      public <NativeResponseType, ModelType> ModelType handleResponse(@Nonnull NativeResponseType response, @Nullable HashMap<String,ParsableFactory<? extends Parsable>> errorMappings)
      Description copied from interface: ResponseHandler
      Callback method that is invoked when a response is received.
      Specified by:
      handleResponse in interface ResponseHandler
      Type Parameters:
      NativeResponseType - The type of the native response object.
      ModelType - The type of the response model object.
      Parameters:
      response - The native response object.
      errorMappings - the error mappings for the response to use when deserializing failed responses bodies. Where an error code like 401 applies specifically to that status code, a class code like 4XX applies to all status codes within the range if an the specific error code is not present.
      Returns:
      The deserialized response model object.
    • setErrorMappings

      public void setErrorMappings(@Nonnull Map<String,ParsableFactory<? extends Parsable>> errorMappings)
      Set the error mappings for the response to use when deserializing failed responses bodies.
      Parameters:
      errorMappings - The designated error mappings.
    • getErrorMappings

      @Nonnull public Map<String,ParsableFactory<? extends Parsable>> getErrorMappings()
      Get the error mappings for the response when deserializing failed response bodies.
      Returns:
      The error mappings for failed response bodies.
    • getValue

      @Nullable public Object getValue()
      Get the value for the response.
      Returns:
      the value of the response.