-
public class GigyaApiResponseGigya generic response class.
-
-
Field Summary
Fields Modifier and Type Field Description public final static intINVALID_VALUEpublic final static intOKprivate Gsongson
-
Constructor Summary
Constructors Constructor Description GigyaApiResponse(String json)
-
Method Summary
Modifier and Type Method Description GsongetGson()StringasJson()Get JSON formatted of the current response. Map<String, Object>asMap()Get Map formatted of the current response. <T> TparseTo(Class<T> clazz)Optional parsing of the current response with generic given type. <A> AparseAccountTo(Class<A> clazz)Account object requires specific parser in order to be aligned withSite schema object. booleancontains(String key)Check if response parameters contains a specific key. booleancontainsNested(String key)Check if response parameters contains a specific nested key.Nested key example: profile. <T> TgetField(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. intgetStatusCode()Get response status code intgetErrorCode()Get response error code. StringgetErrorDetails()Get response error details if exists. StringgetStatusReason()Get response status reason if exists. StringgetCallId()Get response callId. StringgetTime()Get response time. StringgetErrorFlags()Get response error flags if exists. -
-
Constructor Detail
-
GigyaApiResponse
GigyaApiResponse(String json)
-
-
Method Detail
-
getGson
Gson getGson()
-
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.
-
getStatusCode
int getStatusCode()
Get response status code
-
getErrorCode
int getErrorCode()
Get response error code.
-
getErrorDetails
@Nullable() String getErrorDetails()
Get response error details if exists.
-
getStatusReason
@Nullable() String getStatusReason()
Get response status reason if exists.
-
getErrorFlags
String getErrorFlags()
Get response error flags if exists.
-
-
-
-