Class Functions0
- java.lang.Object
-
- org.eclipse.collections.impl.block.factory.Functions0
-
public final class Functions0 extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Function0<Boolean>
getFalse()
static Function0<Boolean>
getTrue()
static <T> Function0<MutableList<T>>
newFastList()
static <T> Function0<MutableBag<T>>
newHashBag()
static <K,V>
Function0<MutableMap<K,V>>newUnifiedMap()
static <T> Function0<MutableSet<T>>
newUnifiedSet()
static <T> Function0<T>
nullValue()
static <T> Function0<T>
throwing(ThrowingFunction0<T> throwingFunction0)
Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Function that will throw a RuntimeException, wrapping the checked exception that is the cause.static <T> Function0<T>
throwing(ThrowingFunction0<T> throwingFunction0, Function<? super Throwable,? extends RuntimeException> rethrow)
Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Function0 that will throw a user specified RuntimeException based on the provided function.static <T> Function0<T>
value(T t)
static Function0<AtomicInteger>
zeroAtomicInteger()
static Function0<AtomicLong>
zeroAtomicLong()
static Function0<BigDecimal>
zeroBigDecimal()
static Function0<BigInteger>
zeroBigInteger()
static Function0<Integer>
zeroInteger()
-
-
-
Method Detail
-
newFastList
public static <T> Function0<MutableList<T>> newFastList()
-
newUnifiedSet
public static <T> Function0<MutableSet<T>> newUnifiedSet()
-
newHashBag
public static <T> Function0<MutableBag<T>> newHashBag()
-
newUnifiedMap
public static <K,V> Function0<MutableMap<K,V>> newUnifiedMap()
-
throwing
public static <T> Function0<T> throwing(ThrowingFunction0<T> throwingFunction0)
Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Function that will throw a RuntimeException, wrapping the checked exception that is the cause.
-
throwing
public static <T> Function0<T> throwing(ThrowingFunction0<T> throwingFunction0, Function<? super Throwable,? extends RuntimeException> rethrow)
Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Function0 that will throw a user specified RuntimeException based on the provided function. The function is passed the current element and the checked exception that was thrown as context arguments.
-
nullValue
public static <T> Function0<T> nullValue()
-
value
public static <T> Function0<T> value(T t)
-
zeroAtomicInteger
public static Function0<AtomicInteger> zeroAtomicInteger()
-
zeroAtomicLong
public static Function0<AtomicLong> zeroAtomicLong()
-
zeroBigDecimal
public static Function0<BigDecimal> zeroBigDecimal()
- Since:
- 6.0
-
zeroBigInteger
public static Function0<BigInteger> zeroBigInteger()
- Since:
- 6.0
-
-