it.auties.whatsapp.api.AsyncVerificationCodeSupplier Maven / Gradle / Ivy
package it.auties.whatsapp.api;
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;
/**
* An interface to represent a supplier that returns a code wrapped in a CompletableFuture
*/
public interface AsyncVerificationCodeSupplier extends Supplier> {
/**
* Creates an asynchronous supplier from a synchronous one
*
* @param supplier a non-null supplier
* @return a non-null async supplier
*/
static AsyncVerificationCodeSupplier of(Supplier supplier) {
return () -> CompletableFuture.completedFuture(supplier.get());
}
}