Class AbstractApi
- java.lang.Object
-
- com.github.vbauer.yta.service.basic.AbstractApi
-
- Direct Known Subclasses:
DetectionApiImpl
,LanguageApiImpl
,TranslationApiImpl
,YTranslateApiImpl
@ThreadSafe public abstract class AbstractApi extends java.lang.Object
Basic class for API services.
-
-
Constructor Summary
Constructors Constructor Description AbstractApi(ApiContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> T
callMethod(java.lang.Class<T> targetClass, java.lang.String method, java.util.Map<java.lang.String,java.lang.Object> parameters)
protected RestClient
client()
Get REST client from API context.protected DataConverter
converter()
Get data converter from API context.
-
-
-
Constructor Detail
-
AbstractApi
public AbstractApi(@Nonnull ApiContext context)
-
-
Method Detail
-
client
@Nonnull protected final RestClient client()
Get REST client from API context.- Returns:
- REST client
-
converter
@Nonnull protected final DataConverter converter()
Get data converter from API context.- Returns:
- data converter
-
callMethod
protected final <T> T callMethod(java.lang.Class<T> targetClass, java.lang.String method, java.util.Map<java.lang.String,java.lang.Object> parameters)
-
-