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

License:Apache License

/**
 *  (asynchronously)/*from   www.  j av a 2  s .c  o m*/
 * 
 * @param skip  (required)
 * @param take  (required)
 * @param filter  (optional)
 * @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 gETpublicV41VehiclesAsync(Integer skip, Integer take, String filter,
        final ApiCallback<ResponseMessageCollectionListAd> 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 = gETpublicV41VehiclesCall(skip, take, filter, progressListener,
            progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageCollectionListAd>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

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

License:Apache License

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

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

License:Apache License

/**
 *  (asynchronously)//from w  w  w .  ja  v a  2s.c  om
 * 
 * @param filter  (optional)
 * @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 gETpublicV41VehiclesCountAsync(String filter,
        final ApiCallback<ResponseMessageCount> 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 = gETpublicV41VehiclesCountCall(filter, progressListener,
            progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageCount>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

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

License:Apache License

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

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

License:Apache License

/**
 *  (asynchronously)//from www.j a  va  2 s  .  c o m
 * 
 * @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 gETpublicV41VehiclesIdAsync(Integer id,
        final ApiCallback<ResponseMessageAd> 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 = gETpublicV41VehiclesIdCall(id, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageAd>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

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

License:Apache License

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

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

License:Apache License

/**
 *  (asynchronously)//www  . j  a va 2 s  .c  o m
 * 
 * @param vehicleId  (required)
 * @param filter  (optional)
 * @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 gETpublicV41VehiclesVehicleidAlternativesAsync(Integer vehicleId, String filter,
        final ApiCallback<ResponseMessageCollectionListAd> 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 = gETpublicV41VehiclesVehicleidAlternativesCall(vehicleId, filter,
            progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageCollectionListAd>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

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

License:Apache License

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

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

License:Apache License

/**
 *  (asynchronously)//w ww  .  j  a va 2 s .  c  o m
 * 
 * @param vehicleId  (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 gETpublicV41VehiclesVehicleidIsonlineAsync(Integer vehicleId,
        final ApiCallback<ResponseMessageBoolean> 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 = gETpublicV41VehiclesVehicleidIsonlineCall(vehicleId, progressListener,
            progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageBoolean>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

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

License:Apache License

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