it.auties.whatsapp.api.AsyncVerificationCodeSupplier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cobalt Show documentation
Show all versions of cobalt Show documentation
Standalone fully-featured Whatsapp Web API for Java and Kotlin
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());
}
}