Package de.thomas_oster.lazysql
Class Lazy<T,E extends Throwable>
java.lang.Object
de.thomas_oster.lazysql.Lazy<T,E>
- Type Parameters:
T-E-
Class for a Thread-Safe LazyEvaluated supplier which can
throw exceptions
- Author:
- Thomas Oster (thomas.oster@upstart-it.de)
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Lazy
-
-
Method Details
-
of
-
get
Calculates the value and caches the result if no Exception occurs. After that only the cached result is returned until the reset method is called (even if the value was null)- Returns:
- the value calculated, even null
- Throws:
E- an exception if the supplier method throws one
-
getValue
Alias for get() for supporting JavaBean Style- Returns:
- Throws:
E
-
reset
public void reset()
-