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

com.github.zxbu.webdavteambition.util.update.BaseUpdateChecker Maven / Gradle / Ivy

There is a newer version: 2.0.5
Show newest version
package com.github.zxbu.webdavteambition.util.update;

import com.github.zxbu.webdavteambition.bean.UpdateInfo;
import com.github.zxbu.webdavteambition.inf.IUpdateCheck;
import com.github.zxbu.webdavteambition.inf.UpdateResultListener;

/**
 * Created by Jason on 2017/9/9.
 */

public abstract class BaseUpdateChecker implements IUpdateCheck, UpdateResultListener {

    private UpdateResultListener mResultListener;

    public BaseUpdateChecker(UpdateResultListener listener) {
        mResultListener = listener;
    }

    @Override
    public void onNoUpdate() {
        UpdateResultListener listener = mResultListener;
        if (listener == null) {
            return;
        }
        listener.onNoUpdate();
    }

    @Override
    public void onNetErr(Exception exception) {
        UpdateResultListener listener = mResultListener;
        if (listener == null) {
            return;
        }
        listener.onNetErr(exception);
    }

    @Override
    public void onHasUpdate(UpdateInfo updateInfo) {
        UpdateResultListener listener = mResultListener;
        if (listener == null) {
            return;
        }
        listener.onHasUpdate(updateInfo);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy