Class Functions0
- java.lang.Object
-
- org.eclipse.collections.impl.block.factory.Functions0
-
public final class Functions0 extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Functions0.AtomicIntegerZeroFunction
private static class
Functions0.AtomicLongZeroFunction
private static class
Functions0.BigDecimalZeroFunction
private static class
Functions0.BigIntegerZeroFunction
private static class
Functions0.FalseFunction
private static class
Functions0.IntegerZeroFunction
private static class
Functions0.NewFastListFunction<T>
private static class
Functions0.NewHashBagFunction<T>
private static class
Functions0.NewUnifiedMapFunction<K,V>
private static class
Functions0.NewUnifiedSetFunction<T>
private static class
Functions0.NullFunction<T>
private static class
Functions0.ThrowingFunction0Adapter<T>
private static class
Functions0.TrueFunction
-
Field Summary
Fields Modifier and Type Field Description private static Functions0.AtomicIntegerZeroFunction
ATOMIC_INTEGER_ZERO
private static Functions0.AtomicLongZeroFunction
ATOMIC_LONG_ZERO
private static Functions0.BigDecimalZeroFunction
BIG_DECIMAL_ZERO
private static Functions0.BigIntegerZeroFunction
BIG_INTEGER_ZERO
private static Functions0.FalseFunction
FALSE_FUNCTION
private static Functions0.IntegerZeroFunction
INTEGER_ZERO
private static Functions0.NewFastListFunction<?>
NEW_FAST_LIST_FUNCTION
private static Functions0.NewHashBagFunction<?>
NEW_HASH_BAG_FUNCTION
private static Functions0.NewUnifiedMapFunction<?,?>
NEW_UNIFIED_MAP_FUNCTION
private static Functions0.NewUnifiedSetFunction<?>
NEW_UNIFIED_SET_FUNCTION
private static Functions0.NullFunction<?>
NULL_FUNCTION
private static Functions0.TrueFunction
TRUE_FUNCTION
-
Constructor Summary
Constructors Modifier Constructor Description private
Functions0()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Function0<java.lang.Boolean>
getFalse()
static Function0<java.lang.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 java.lang.Throwable,? extends java.lang.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<java.util.concurrent.atomic.AtomicInteger>
zeroAtomicInteger()
static Function0<java.util.concurrent.atomic.AtomicLong>
zeroAtomicLong()
static Function0<java.math.BigDecimal>
zeroBigDecimal()
static Function0<java.math.BigInteger>
zeroBigInteger()
static Function0<java.lang.Integer>
zeroInteger()
-
-
-
Field Detail
-
TRUE_FUNCTION
private static final Functions0.TrueFunction TRUE_FUNCTION
-
FALSE_FUNCTION
private static final Functions0.FalseFunction FALSE_FUNCTION
-
NEW_FAST_LIST_FUNCTION
private static final Functions0.NewFastListFunction<?> NEW_FAST_LIST_FUNCTION
-
NEW_UNIFIED_SET_FUNCTION
private static final Functions0.NewUnifiedSetFunction<?> NEW_UNIFIED_SET_FUNCTION
-
NEW_HASH_BAG_FUNCTION
private static final Functions0.NewHashBagFunction<?> NEW_HASH_BAG_FUNCTION
-
NEW_UNIFIED_MAP_FUNCTION
private static final Functions0.NewUnifiedMapFunction<?,?> NEW_UNIFIED_MAP_FUNCTION
-
NULL_FUNCTION
private static final Functions0.NullFunction<?> NULL_FUNCTION
-
ATOMIC_INTEGER_ZERO
private static final Functions0.AtomicIntegerZeroFunction ATOMIC_INTEGER_ZERO
-
ATOMIC_LONG_ZERO
private static final Functions0.AtomicLongZeroFunction ATOMIC_LONG_ZERO
-
INTEGER_ZERO
private static final Functions0.IntegerZeroFunction INTEGER_ZERO
-
BIG_DECIMAL_ZERO
private static final Functions0.BigDecimalZeroFunction BIG_DECIMAL_ZERO
-
BIG_INTEGER_ZERO
private static final Functions0.BigIntegerZeroFunction BIG_INTEGER_ZERO
-
-
Method Detail
-
getTrue
public static Function0<java.lang.Boolean> getTrue()
- Since:
- 6.0
-
getFalse
public static Function0<java.lang.Boolean> getFalse()
- Since:
- 6.0
-
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 java.lang.Throwable,? extends java.lang.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)
-
zeroInteger
public static Function0<java.lang.Integer> zeroInteger()
-
zeroAtomicInteger
public static Function0<java.util.concurrent.atomic.AtomicInteger> zeroAtomicInteger()
-
zeroAtomicLong
public static Function0<java.util.concurrent.atomic.AtomicLong> zeroAtomicLong()
-
zeroBigDecimal
public static Function0<java.math.BigDecimal> zeroBigDecimal()
- Since:
- 6.0
-
zeroBigInteger
public static Function0<java.math.BigInteger> zeroBigInteger()
- Since:
- 6.0
-
-