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.DealersApi.java

License:Apache License

/**
 *  (asynchronously)/*from www  .jav  a2 s. c om*/
 * 
 * @param dealerPageRequest  (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 pOSTpublicV41DealersDealerpagerequestAsync(DealerPageRequest dealerPageRequest,
        final ApiCallback<ResponseMessageDealerPageRequest> 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 = pOSTpublicV41DealersDealerpagerequestCall(dealerPageRequest,
            progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageDealerPageRequest>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

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

License:Apache License

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

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

License:Apache License

/**
 *  (asynchronously)//w ww  . j a  v a2 s  . co m
 * 
 * @param sendToFriendRequest  (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 pOSTpublicV41DealersSendtofriendAsync(SendToFriendRequest sendToFriendRequest,
        final ApiCallback<ResponseMessageDictionaryStringString> 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 = pOSTpublicV41DealersSendtofriendCall(sendToFriendRequest, progressListener,
            progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageDictionaryStringString>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

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

License:Apache License

/**
 * /*from  www  . j a va  2 s .c  om*/
 * 
 * @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> gETpublicV41DevicesTokensWithHttpInfo() throws ApiException {
    com.squareup.okhttp.Call call = gETpublicV41DevicesTokensCall(null, null);
    Type localVarReturnType = new TypeToken<ResponseMessageString>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}

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

License:Apache License

/**
 *  (asynchronously)/*from w  w w  .  j a  va  2 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 gETpublicV41DevicesTokensAsync(
        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 = gETpublicV41DevicesTokensCall(progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageString>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

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

License:Apache License

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

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

License:Apache License

/**
 *  (asynchronously)//from  w w w . j  a v a2 s  .co 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 pOSTpublicV41DevicesTokensAsync(
        final ApiCallback<ResponseMessageDeviceToken> 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 = pOSTpublicV41DevicesTokensCall(progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageDeviceToken>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

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

License:Apache License

/**
 * /*w w  w.  ja  v a  2s  .  c  o m*/
 * 
 * @return ApiResponse&lt;ResponseMessageDeviceToken&gt;
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
public ApiResponse<ResponseMessageDeviceToken> pUTpublicV41DevicesTokensWithHttpInfo() throws ApiException {
    com.squareup.okhttp.Call call = pUTpublicV41DevicesTokensCall(null, null);
    Type localVarReturnType = new TypeToken<ResponseMessageDeviceToken>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}

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

License:Apache License

/**
 *  (asynchronously)//  w w w . j  a va2s .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 pUTpublicV41DevicesTokensAsync(
        final ApiCallback<ResponseMessageDeviceToken> 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 = pUTpublicV41DevicesTokensCall(progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageDeviceToken>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

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

License:Apache License

/**
 * //from   w w w  .j av a2  s  .c  om
 * 
 * @param userId  (required)
 * @param skip  (optional)
 * @param take  (optional)
 * @param filter  (optional)
 * @return ApiResponse&lt;ResponseMessageCollectionListFavoriteVehicle&gt;
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
public ApiResponse<ResponseMessageCollectionListFavoriteVehicle> gETpublicV41UsersUseridFavoritevehiclesWithHttpInfo(
        Integer userId, Integer skip, Integer take, String filter) throws ApiException {
    com.squareup.okhttp.Call call = gETpublicV41UsersUseridFavoritevehiclesCall(userId, skip, take, filter,
            null, null);
    Type localVarReturnType = new TypeToken<ResponseMessageCollectionListFavoriteVehicle>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}