T
- The type of Retrofit APIpublic class Retrofit2<T> extends BaseRetrofit<T,Retrofit.Builder>
BaseResponseLoaderWrapper.CoreLoad
Modifier and Type | Class and Description |
---|---|
static class |
Retrofit2.Retrofit2AdapterWrapper<D>
Extends the
ValuesCacheAdapterWrapper class to provide Retrofit 2 support. |
static class |
Retrofit2.Retrofit2Rx<D>
Extends the
BaseRx.LoaderRx class to provide Retrofit 2 support. |
Constructor and Description |
---|
Retrofit2()
Initialises a newly created
Retrofit2 object. |
Modifier and Type | Method and Description |
---|---|
protected okhttp3.Cookie |
createCookie(String name,
String value,
okhttp3.HttpUrl url)
Creates a cookie.
|
Retrofit.Builder |
getDefaultBuilder(String retrofitBase)
Please refer to the base method description.
|
okhttp3.OkHttpClient.Builder |
getDefaultOkHttpClientBuilder()
Returns the default
OkHttpClient builder. |
okhttp3.OkHttpClient.Builder |
getDefaultOkHttpClientBuilder(int connectTimeout,
int readTimeout,
Map<String,String> headers,
Map<String,String> cookies)
Returns the default
OkHttpClient builder. |
Class<T> |
getService()
Returns the service interface.
|
void |
init(Class<T> service,
Retrofit.Builder builder,
int connectTimeout,
int readTimeout)
Please refer to the base method description.
|
void |
init(Class<T> service,
String retrofitBase,
int connectTimeout,
int readTimeout,
Map<String,String> headers)
Please refer to the base method description.
|
void |
init(Class<T> service,
String retrofitBase,
int connectTimeout,
int readTimeout,
Map<String,String> headers,
Map<String,String> cookies)
Initialises Retrofit client.
|
getApi, getConnectionTimeout, init, init
public Class<T> getService()
public void init(@NonNull Class<T> service, @NonNull String retrofitBase, int connectTimeout, int readTimeout, @Nullable Map<String,String> headers)
init
in class BaseRetrofit<T,Retrofit.Builder>
service
- The service interfaceretrofitBase
- The Retrofit API endpoint URLconnectTimeout
- The connection timeout (in seconds)readTimeout
- The read timeout (in seconds)headers
- The optional HTTP headers (or null)public void init(@NonNull Class<T> service, @NonNull String retrofitBase, int connectTimeout, int readTimeout, @Nullable Map<String,String> headers, @Nullable Map<String,String> cookies)
service
- The service interfaceretrofitBase
- The Retrofit API endpoint URLconnectTimeout
- The connection timeout (in seconds)readTimeout
- The read timeout (in seconds)headers
- The optional HTTP headers (or null)cookies
- The optional cookies (or null)public void init(@NonNull Class<T> service, @NonNull Retrofit.Builder builder, int connectTimeout, int readTimeout)
init
in class BaseRetrofit<T,Retrofit.Builder>
service
- The service interfacebuilder
- The RetrofitBuilderconnectTimeout
- The connection timeout (in seconds)readTimeout
- The read timeout (in seconds)public Retrofit.Builder getDefaultBuilder(@NonNull String retrofitBase)
getDefaultBuilder
in class BaseRetrofit<T,Retrofit.Builder>
retrofitBase
- The service API endpoint URLpublic okhttp3.OkHttpClient.Builder getDefaultOkHttpClientBuilder()
OkHttpClient
builder.OkHttpClient
builderpublic okhttp3.OkHttpClient.Builder getDefaultOkHttpClientBuilder(int connectTimeout, int readTimeout, @Nullable Map<String,String> headers, @Nullable Map<String,String> cookies)
OkHttpClient
builder.connectTimeout
- The connection timeout (in seconds)readTimeout
- The read timeout (in seconds)headers
- The optional HTTP headers (or null)cookies
- The optional cookies (or null)OkHttpClient
builder
Copyright © 2015-2017 akha, a.k.a. Alexander Kharitonov
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.