com.pubnub.api.java.callbacks.PNCallback Maven / Gradle / Ivy
package com.pubnub.api.java.callbacks;
import com.pubnub.api.PubNubException;
import com.pubnub.api.v2.callbacks.Result;
import org.jetbrains.annotations.Nullable;
import java.util.function.Consumer;
public interface PNCallback extends Consumer> {
void onResponse(@Nullable X result, @Nullable PubNubException exception);
@Override
default void accept(Result xResult) {
onResponse(xResult.getOrNull(), xResult.exceptionOrNull());
}
}