Package 

Class GigyaApiResponse

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static int INVALID_VALUE
      public final static int OK
      private Gson gson
    • Method Summary

      Modifier and Type Method Description
      Gson getGson()
      String asJson() Get JSON formatted of the current response.
      Map<String, Object> asMap() Get Map formatted of the current response.
      <T> T parseTo(Class<T> clazz) Optional parsing of the current response with generic given type.
      <A> A parseAccountTo(Class<A> clazz) Account object requires specific parser in order to be aligned withSite schema object.
      boolean contains(String key) Check if response parameters contains a specific key.
      boolean containsNested(String key) Check if response parameters contains a specific nested key.Nested key example: profile.
      <T> T getField(String key, Class<T> clazz) Type field optional getter.Allows fetching an parsed object from response parameters given required type.Uses GSON as the parsing engine.
      int getStatusCode() Get response status code
      int getErrorCode() Get response error code.
      String getErrorDetails() Get response error details if exists.
      String getStatusReason() Get response status reason if exists.
      String getCallId() Get response callId.
      String getTime() Get response time.
      String getErrorFlags() Get response error flags if exists.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GigyaApiResponse

        GigyaApiResponse(String json)
    • Method Detail

      • asJson

         String asJson()

        Get JSON formatted of the current response.

      • parseTo

        @Nullable() <T> T parseTo(Class<T> clazz)

        Optional parsing of the current response with generic given type. Uses GSON as the parsing engine.

        Parameters:
        clazz - Requested type for parsing.
      • parseAccountTo

        @Nullable() <A> A parseAccountTo(Class<A> clazz)

        Account object requires specific parser in order to be aligned withSite schema object.

      • contains

         boolean contains(String key)

        Check if response parameters contains a specific key.

        Parameters:
        key - Required key for evaluation.
      • containsNested

         boolean containsNested(String key)

        Check if response parameters contains a specific nested key.Nested key example: profile.firstName

        Parameters:
        key - Required key for evaluation.
      • getField

        @Nullable() <T> T getField(String key, Class<T> clazz)

        Type field optional getter.Allows fetching an parsed object from response parameters given required type.Uses GSON as the parsing engine.

        Parameters:
        key - Requested parameter key.
        clazz - Required parsed object type.