Class SlimCallback<T>

  • Type Parameters:
    T - generalized type
    All Implemented Interfaces:
    retrofit2.Callback<T>

    public class SlimCallback<T>
    extends Object
    implements retrofit2.Callback<T>
    This class generalized the call back function in retrofit calls
    Author:
    Saiyara Iftekharuzzaman
    • Constructor Detail

      • SlimCallback

        public SlimCallback​(LambdaInterface<T> lambdaInterface)
        constructor for slimback call
        Parameters:
        lambdaInterface - lambdaInterface class
    • Method Detail

      • onResponse

        public void onResponse​(retrofit2.Call<T> call,
                               retrofit2.Response<T> response)
        handles retrofit call response
        Specified by:
        onResponse in interface retrofit2.Callback<T>
        Parameters:
        call - retrofit call
        response - response from backend
      • onFailure

        public void onFailure​(retrofit2.Call<T> call,
                              Throwable t)
        handles retrofit failure response
        Specified by:
        onFailure in interface retrofit2.Callback<T>
        Parameters:
        call - retrofit call
        t - generalized type