com.kucoin.sdk.rest.impl.retrofit.AuthRetrofitAPIImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kucoin-java-sdk Show documentation
Show all versions of kucoin-java-sdk Show documentation
Fixed fork of the official Kucoin SDK
The newest version!
/**
* Copyright 2019 Mek Global Limited.
*/
package com.kucoin.sdk.rest.impl.retrofit;
import com.kucoin.sdk.factory.RetrofitFactory;
import java.lang.reflect.ParameterizedType;
/**
* Created by chenshiwei on 2019/1/10.
*/
public class AuthRetrofitAPIImpl extends AbstractRetrofitAPIImpl {
private volatile boolean inited;
private T apiImpl;
@Override
public T getAPIImpl() {
if (inited)
return apiImpl;
synchronized (getClass()) {
if (inited)
return apiImpl;
@SuppressWarnings("unchecked")
Class tClass = (Class) ((ParameterizedType) this.getClass().getGenericSuperclass())
.getActualTypeArguments()[0];
T t = RetrofitFactory.getAuthRetorfit(baseUrl, apiKey, secret, passPhrase)
.create(tClass);
apiImpl = t;
return t;
}
}
}