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

com.github.kubatatami.judonetworking.VirtualCallback Maven / Gradle / Ivy

package com.github.kubatatami.judonetworking;

class VirtualCallback implements CallbackInterface {
    private int id;
    private RequestResult result;

    VirtualCallback(int id) {
        this.id = id;
    }

    @Override
    public void onFinish(Object result) {
        this.result = new RequestSuccessResult(id, result);
    }

    @Override
    public void onError(Exception e) {
        this.result = new ErrorResult(id, e);
    }

    @Override
    public void onProgress(int progress) {
        throw new IllegalAccessError("Virtual server can't invoke onProgress");
    }

    public RequestResult getResult() {
        return result;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy