All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.citrix.sharefile.api.interfaces.ISFApiResultResponseTranslator Maven / Gradle / Ivy

package com.citrix.sharefile.api.interfaces;


import com.citrix.sharefile.api.exceptions.SFSDKException;
import com.citrix.sharefile.api.models.SFODataObject;
import com.citrix.sharefile.api.utils.Utils;

/**
 *  Helper class for the app to implement internal listeners
 * @param 
 * @param 
 */
public abstract class ISFApiResultResponseTranslator implements ISFApiResultCallback
{
	private ISFApiResultCallback mListener;

	public ISFApiResultResponseTranslator(ISFApiResultCallback listener)
	{
		mListener = listener;
	}

    public ISFApiResultResponseTranslator()
    {

    }

	public void setListener(ISFApiResultCallback listener)
	{
		mListener = listener;
	}

    public abstract T2 translate(T sfobject);

    @Override
    public void onSuccess(T object)
    {
        Utils.safeCallSuccess(mListener,translate(object));
    }

    @Override
    public void onError(SFSDKException exception, ISFQuery query)
    {
        Utils.safeCallErrorListener(mListener,exception,query);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy