fr.alexpado.jda.interactions.interfaces.interactions.Injection Maven / Gradle / Ivy
package fr.alexpado.jda.interactions.interfaces.interactions;
import java.util.function.Supplier;
/**
* Interface used to represent an injection.
*
* @param
* The type of the event source
* @param
* The type of the mapped value.
*/
public interface Injection {
/**
* Retrieve the supplier that will allow to lazy-load a {@link U} instance.
*
* @param event
* The event {@link T} from which information about the context can be used.
*
* @return A supplier to lazy-load a value of type {@link U}.
*/
Supplier inject(T event);
}