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: 3.5.1
Show newest version
package it.auties.whatsapp.api;

import lombok.NonNull;

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 syncronous one
     *
     * @param supplier a non-null supplier
     * @return a non-null async supplier
     */
    static AsyncVerificationCodeSupplier of(@NonNull Supplier supplier){
        return () -> CompletableFuture.completedFuture(supplier.get());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy