com.petersamokhin.bots.sdk.utils.vkapi.calls.CallAsync Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vk-bot-java-sdk Show documentation
Show all versions of vk-bot-java-sdk Show documentation
SDK for interacting with VK.com API
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());
}
}