kr.co.hanwha.hifive.network.hanwha

## Class HanwhaNetworkClient<T>

- java.lang.Object
- - kr.co.hanwha.hifive.network.hanwha.HanwhaNetworkClient<T>

-     public class HanwhaNetworkClient<T>
      extends java.lang.Object

  Created by sanghoonkwon on 2018. 1. 11..

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `HanwhaNetworkClient.Builder` HanwhaNetworkClient Builder
    `static class` | `HanwhaNetworkClient.REST`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) okhttp3.OkHttpClient` | `client`
    `(package private) int` | `connectTimeout`
    `(package private) int` | `readTimeout`
    `(package private) int` | `writeTimeout`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HanwhaNetworkClient()`
    `HanwhaNetworkClient(HanwhaNetworkClient.Builder builder)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `call(okhttp3.Request request, java.lang.Class<T> object, HanwhaNetworkCallback callback)`
    `okhttp3.Request` | `delete(java.lang.String url, okhttp3.Headers headers, java.lang.String param)`
    `okhttp3.Request` | `delete(java.lang.String url, java.lang.String param)`
    `okhttp3.Request` | `get(java.lang.String url, okhttp3.Headers headers, java.lang.String param)`
    `okhttp3.Request` | `get(java.lang.String url, java.lang.String param)`
    `int` | `getReadTimeout()`
    `private void` | `initOkHttpClient()`
    `private void` | `onResponseFailure(HanwhaNetworkError error, HanwhaNetworkCallback callback)`
    `private void` | `onResponseFailure(okhttp3.Response response, HanwhaNetworkCallback callback)`
    `private void` | `onResponseSuccess(java.lang.Class<T> object, okhttp3.Response response, HanwhaNetworkCallback callback)`
    `okhttp3.Request` | `post(java.lang.String url, okhttp3.Headers headers, java.lang.String param)`
    `okhttp3.Request` | `post(java.lang.String url, java.lang.String param)`
    `okhttp3.Request` | `postUrl(java.lang.String url, okhttp3.Headers headers, java.lang.String param)`
    `okhttp3.Request` | `put(java.lang.String url, okhttp3.Headers headers, java.lang.String param)`
    `okhttp3.Request` | `put(java.lang.String url, java.lang.String param)`
    `void` | `request(android.content.Context context, HanwhaNetworkClient.REST rest, java.lang.String url, java.lang.Class<T> object, HanwhaNetworkCallback callback)`
    `void` | `request(android.content.Context context, HanwhaNetworkClient.REST rest, java.lang.String url, java.util.HashMap<java.lang.String,java.lang.Object> map, java.lang.Class<T> object, HanwhaNetworkCallback callback)`
    `void` | `request(android.content.Context context, HanwhaNetworkClient.REST rest, java.lang.String url, java.util.HashMap<java.lang.String,java.lang.String> header, java.util.HashMap<java.lang.String,java.lang.Object> map, java.lang.Class<T> object, HanwhaNetworkCallback callback)`
    `private void` | `runOnUiThread(java.lang.Runnable task)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### connectTimeout

          final int connectTimeout

    - #### readTimeout

          final int readTimeout

    - #### writeTimeout

          final int writeTimeout

    - #### client

          okhttp3.OkHttpClient client

  - ### Constructor Detail

    - #### HanwhaNetworkClient

          public HanwhaNetworkClient()

    - #### HanwhaNetworkClient

          HanwhaNetworkClient(HanwhaNetworkClient.Builder builder)

  - ### Method Detail

    - #### initOkHttpClient

          private void initOkHttpClient()

    - #### request

          public void request(@NonNull
                              android.content.Context context,
                              @NonNull
                              HanwhaNetworkClient.REST rest,
                              @NonNull
                              java.lang.String url,
                              @NonNull
                              java.lang.Class<T> object,
                              @Nullable
                              HanwhaNetworkCallback callback)

    - #### request

          public void request(@NonNull
                              android.content.Context context,
                              @NonNull
                              HanwhaNetworkClient.REST rest,
                              @NonNull
                              java.lang.String url,
                              @Nullable
                              java.util.HashMap<java.lang.String,java.lang.Object> map,
                              @NonNull
                              java.lang.Class<T> object,
                              @Nullable
                              HanwhaNetworkCallback callback)

    - #### request

          public void request(@NonNull
                              android.content.Context context,
                              @NonNull
                              HanwhaNetworkClient.REST rest,
                              @NonNull
                              java.lang.String url,
                              @NonNull
                              java.util.HashMap<java.lang.String,java.lang.String> header,
                              @Nullable
                              java.util.HashMap<java.lang.String,java.lang.Object> map,
                              @NonNull
                              java.lang.Class<T> object,
                              @Nullable
                              HanwhaNetworkCallback callback)

      Parameters:
        `rest` - GET, POST, DELETE, PUT
        `url` - request URL
        `header` - headers
        `map` - parameters
        `object` - return class
        `callback` - callback

    - #### get

          public okhttp3.Request get(@NonNull
                                     java.lang.String url,
                                     @Nullable
                                     java.lang.String param)

    - #### get

          public okhttp3.Request get(@NonNull
                                     java.lang.String url,
                                     @NonNull
                                     okhttp3.Headers headers,
                                     @Nullable
                                     java.lang.String param)

    - #### post

          public okhttp3.Request post(@NonNull
                                      java.lang.String url,
                                      @NonNull
                                      java.lang.String param)
                               throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### post

          public okhttp3.Request post(@NonNull
                                      java.lang.String url,
                                      @NonNull
                                      okhttp3.Headers headers,
                                      @NonNull
                                      java.lang.String param)
                               throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### postUrl

          public okhttp3.Request postUrl(@NonNull
                                         java.lang.String url,
                                         @NonNull
                                         okhttp3.Headers headers,
                                         @NonNull
                                         java.lang.String param)

    - #### delete

          public okhttp3.Request delete(@NonNull
                                        java.lang.String url,
                                        @NonNull
                                        java.lang.String param)

    - #### delete

          public okhttp3.Request delete(@NonNull
                                        java.lang.String url,
                                        @NonNull
                                        okhttp3.Headers headers,
                                        @NonNull
                                        java.lang.String param)

    - #### put

          public okhttp3.Request put(@NonNull
                                     java.lang.String url,
                                     @NonNull
                                     java.lang.String param)

    - #### put

          public okhttp3.Request put(@NonNull
                                     java.lang.String url,
                                     @NonNull
                                     okhttp3.Headers headers,
                                     @NonNull
                                     java.lang.String param)

    - #### call

          private void call(@NonNull
                            okhttp3.Request request,
                            @NonNull
                            java.lang.Class<T> object,
                            @Nullable
                            HanwhaNetworkCallback callback)

    - #### onResponseSuccess

          private void onResponseSuccess(@NonNull
                                         java.lang.Class<T> object,
                                         okhttp3.Response response,
                                         @Nullable
                                         HanwhaNetworkCallback callback)

    - #### onResponseFailure

          private void onResponseFailure(okhttp3.Response response,
                                         @NonNull
                                         HanwhaNetworkCallback callback)

    - #### onResponseFailure

          private void onResponseFailure(@NonNull
                                         HanwhaNetworkError error,
                                         @NonNull
                                         HanwhaNetworkCallback callback)

    - #### runOnUiThread

          private void runOnUiThread(java.lang.Runnable task)

    - #### getReadTimeout

          public int getReadTimeout()