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

it.auties.whatsapp.model.request.ReplyHandler Maven / Gradle / Ivy

There is a newer version: 3.5.1
Show 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<>());
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy