
sirius.kernel.commons.ValueSupplier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sirius-kernel Show documentation
Show all versions of sirius-kernel Show documentation
Provides common core classes and the microkernel powering all Sirius applications
/*
* Made with all the love in the world
* by scireum in Remshalden, Germany
*
* Copyright by scireum GmbH
* http://www.scireum.de - [email protected]
*/
package sirius.kernel.commons;
/**
* Provides a value for the given key just like a {@link java.util.function.Function}.
*
* However, the return value is wrapped as {@link Value}. This permits to distinguish between a null
* and no value. Also by declaring Exception in the throws clause, we delegate the exception handling
* from the callee to the caller.
*
* @param the type of key used as input for the value supplier.
*/
public interface ValueSupplier {
/**
* Computes or fetches the value for the given key.
*
* @param key the key to fetch the value for
* @return the value for the given key or null to indicate that no value is available.
* @throws Exception in case of an error while fetching the value.
*/
Value apply(K key) throws Exception;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy