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

it.auties.whatsapp.api.AsyncVerificationCodeSupplier Maven / Gradle / Ivy

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy