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
`static class` `HanwhaNetworkClient.Builder` HanwhaNetworkClient Builder
`static class` `HanwhaNetworkClient.REST`

### Field Summary

Fields
`(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
`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()`
`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)

#### runOnUiThread

    private void runOnUiThread(java.lang.Runnable task)

#### getReadTimeout

    public int getReadTimeout()