it.auties.whatsapp.model.request.ReplyHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of whatsappweb4j Show documentation
Show all versions of whatsappweb4j Show documentation
Standalone fully-featured Whatsapp Web API for Java and Kotlin
The newest version!
package it.auties.whatsapp.model.request;
import it.auties.whatsapp.model.info.MessageInfo;
import lombok.NonNull;
import java.util.concurrent.CompletableFuture;
/**
* A model class that represents a pending reply that accepts only a result
*
* @param id the non-null id of the message waiting for a reply
* @param future the non-null completable result that will be resolved when a reply becomes
* available
*/
public record ReplyHandler(@NonNull String id, @NonNull CompletableFuture future) {
/**
* Constructs a new single reply
*
* @param id the non-null id of the message waiting for a reply
* @return a non-null reply
*/
public static ReplyHandler of(@NonNull String id) {
return new ReplyHandler(id, new CompletableFuture<>());
}
}