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

sirius.kernel.commons.ValueSupplier Maven / Gradle / Ivy

Go to download

Provides common core classes and the microkernel powering all Sirius applications

There is a newer version: 12.9.1
Show newest version
/*
 * 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