Package pl.grizzlysoftware.util
Class RetrofitCallExecutor
- java.lang.Object
-
- pl.grizzlysoftware.util.RetrofitCallExecutor
-
- All Implemented Interfaces:
OnRetrofitCallExecutionListener
public class RetrofitCallExecutor extends java.lang.Object implements OnRetrofitCallExecutionListener
-
-
Field Summary
Fields Modifier and Type Field Description protected OnRetrofitCallExecutionListenercallExecutionListenerprotected java.lang.Class<?>target
-
Constructor Summary
Constructors Constructor Description RetrofitCallExecutor(java.lang.Class<?> target)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TexecOrThrow(retrofit2.Call<T> call)<T> retrofit2.Response<T>executeOrThrow(retrofit2.Call<T> call)<T> voidonAfterExecution(retrofit2.Call<T> call, retrofit2.Response<T> response)<T> voidonBeforeExecution(retrofit2.Call<T> call)<T> voidonExecutionSuccessful(retrofit2.Call<T> call, retrofit2.Response<T> response)voidsetCallExecutionListener(OnRetrofitCallExecutionListener callExecutionListener)
-
-
-
Field Detail
-
target
protected final java.lang.Class<?> target
-
callExecutionListener
protected OnRetrofitCallExecutionListener callExecutionListener
-
-
Method Detail
-
execOrThrow
public <T> T execOrThrow(retrofit2.Call<T> call)
-
executeOrThrow
public <T> retrofit2.Response<T> executeOrThrow(retrofit2.Call<T> call)
-
setCallExecutionListener
public void setCallExecutionListener(OnRetrofitCallExecutionListener callExecutionListener)
-
onBeforeExecution
public <T> void onBeforeExecution(retrofit2.Call<T> call)
- Specified by:
onBeforeExecutionin interfaceOnRetrofitCallExecutionListener
-
onAfterExecution
public <T> void onAfterExecution(retrofit2.Call<T> call, retrofit2.Response<T> response)- Specified by:
onAfterExecutionin interfaceOnRetrofitCallExecutionListener
-
onExecutionSuccessful
public <T> void onExecutionSuccessful(retrofit2.Call<T> call, retrofit2.Response<T> response)- Specified by:
onExecutionSuccessfulin interfaceOnRetrofitCallExecutionListener
-
-