Example usage for com.google.gson.reflect TypeToken TypeToken

List of usage examples for com.google.gson.reflect TypeToken TypeToken

Introduction

In this page you can find the example usage for com.google.gson.reflect TypeToken TypeToken.

Prototype

@SuppressWarnings("unchecked")
protected TypeToken() 

Source Link

Document

Constructs a new type literal.

Usage

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 *  (asynchronously)//from  w w  w  .  ja  v  a2  s  .  c  om
 * 
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call gETpublicV41UsersAuthorizedAsync(
        final ApiCallback<ResponseMessageUser> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = gETpublicV41UsersAuthorizedCall(progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageUser>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 * /*from   w  ww .j a va  2 s  . co m*/
 * 
 * @return ApiResponse&lt;ResponseMessageString&gt;
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
public ApiResponse<ResponseMessageString> gETpublicV41UsersSecuritytokenWithHttpInfo() throws ApiException {
    com.squareup.okhttp.Call call = gETpublicV41UsersSecuritytokenCall(null, null);
    Type localVarReturnType = new TypeToken<ResponseMessageString>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 *  (asynchronously)//from w w w .  j  a  v a2 s .c  o m
 * 
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call gETpublicV41UsersSecuritytokenAsync(
        final ApiCallback<ResponseMessageString> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = gETpublicV41UsersSecuritytokenCall(progressListener,
            progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageString>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 * //from   www  .  j  a v a  2  s .  c o  m
 * 
 * @param userId  (required)
 * @return ApiResponse&lt;ResponseMessageUser&gt;
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
public ApiResponse<ResponseMessageUser> gETpublicV41UsersUseridWithHttpInfo(Integer userId)
        throws ApiException {
    com.squareup.okhttp.Call call = gETpublicV41UsersUseridCall(userId, null, null);
    Type localVarReturnType = new TypeToken<ResponseMessageUser>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 *  (asynchronously)// ww  w. j a  v a 2 s . c om
 * 
 * @param userId  (required)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call gETpublicV41UsersUseridAsync(Integer userId,
        final ApiCallback<ResponseMessageUser> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = gETpublicV41UsersUseridCall(userId, progressListener,
            progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageUser>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 * //from   w  w w  . ja v  a  2s  .  co  m
 * 
 * @param userId  (required)
 * @return ApiResponse&lt;ResponseMessageListAddress&gt;
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
public ApiResponse<ResponseMessageListAddress> gETpublicV41UsersUseridAddressesWithHttpInfo(Integer userId)
        throws ApiException {
    com.squareup.okhttp.Call call = gETpublicV41UsersUseridAddressesCall(userId, null, null);
    Type localVarReturnType = new TypeToken<ResponseMessageListAddress>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 *  (asynchronously)/*from   w ww . j a v  a  2 s .  com*/
 * 
 * @param userId  (required)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call gETpublicV41UsersUseridAddressesAsync(Integer userId,
        final ApiCallback<ResponseMessageListAddress> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = gETpublicV41UsersUseridAddressesCall(userId, progressListener,
            progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageListAddress>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 * //from w w  w.j ava 2s . c  o m
 * 
 * @param userId  (required)
 * @param id  (required)
 * @return ApiResponse&lt;ResponseMessageAddress&gt;
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
public ApiResponse<ResponseMessageAddress> gETpublicV41UsersUseridAddressesIdWithHttpInfo(Integer userId,
        Integer id) throws ApiException {
    com.squareup.okhttp.Call call = gETpublicV41UsersUseridAddressesIdCall(userId, id, null, null);
    Type localVarReturnType = new TypeToken<ResponseMessageAddress>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 *  (asynchronously)/*from ww w .  java  2s. co m*/
 * 
 * @param userId  (required)
 * @param id  (required)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call gETpublicV41UsersUseridAddressesIdAsync(Integer userId, Integer id,
        final ApiCallback<ResponseMessageAddress> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = gETpublicV41UsersUseridAddressesIdCall(userId, id, progressListener,
            progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageAddress>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 * /*from  w  w  w .java 2 s.  c  om*/
 * 
 * @param userId  (required)
 * @return ApiResponse&lt;ResponseMessageAddress&gt;
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
public ApiResponse<ResponseMessageAddress> gETpublicV41UsersUseridBillingaddressWithHttpInfo(Integer userId)
        throws ApiException {
    com.squareup.okhttp.Call call = gETpublicV41UsersUseridBillingaddressCall(userId, null, null);
    Type localVarReturnType = new TypeToken<ResponseMessageAddress>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}