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

com.petersamokhin.bots.sdk.utils.vkapi.calls.CallAsync Maven / Gradle / Ivy

The newest version!
package com.petersamokhin.bots.sdk.utils.vkapi.calls;

import com.petersamokhin.bots.sdk.callbacks.callbackapi.ExecuteCallback;
import org.json.JSONObject;

import java.util.Objects;

/**
 * Deserialized class of call to vk api using execute method
 */
public class CallAsync extends Call {

    private ExecuteCallback callback;

    public CallAsync(String methodName, JSONObject params, ExecuteCallback callback) {
        this.methodName = methodName;
        this.params = params;
        this.callback = callback;
    }

    public ExecuteCallback getCallback() {
        return callback;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof CallAsync)) return false;
        CallAsync call = (CallAsync) o;
        return Objects.equals(getMethodName(), call.getMethodName()) &&
                Objects.equals(getParams().toMap(), call.getParams().toMap()) &&
                Objects.equals(getCallback(), call.getCallback());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy