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

com.savl.ripple.client.requests.Operation Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
package com.savl.ripple.client.requests;

import com.savl.ripple.client.async.ComposedOperation;
import com.savl.ripple.client.responses.Response;
import org.json.JSONException;

public class Operation extends Request.Manager {
    public int nth;
    public ComposedOperation composed;

    public Operation(int nth, ComposedOperation composed) {
        this.nth = nth;
        this.composed = composed;
    }

    @Override
    public void beforeRequest(Request r) {
        super.beforeRequest(r);
    }

    @Override
    public boolean retryOnUnsuccessful(Response r) {
        return super.retryOnUnsuccessful(r);
    }

    @SuppressWarnings("unchecked")
    @Override
    public void cb(Response response, T t) throws JSONException {
        switch (nth) {
            case 1:
                composed.first(t);
                break;
            case 2:
                composed.second(t);
                break;
            case 3:
                composed.third(t);
                break;
            case 4:
                composed.fourth(t);
                break;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy