Package org.apache.commons.io.function
Class Erase
- java.lang.Object
-
- org.apache.commons.io.function.Erase
-
final class Erase extends java.lang.Object
ErasesIOException
for the compiler but still throws that exception at runtime.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Erase()
No instances.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static <T,U>
voidaccept(IOBiConsumer<T,U> consumer, T t, U u)
Delegates to the givenIOBiConsumer
but erases itsIOException
for the compiler, while still throwing the exception at runtime.(package private) static <T> void
accept(IOConsumer<T> consumer, T t)
Delegates to the givenIOConsumer
but erases itsIOException
for the compiler, while still throwing the exception at runtime.(package private) static <T,U,R>
Rapply(IOBiFunction<? super T,? super U,? extends R> mapper, T t, U u)
Delegates to the givenIOBiFunction
but erases itsIOException
for the compiler, while still throwing the exception at runtime.(package private) static <T,R>
Rapply(IOFunction<? super T,? extends R> mapper, T t)
Delegates to the givenIOFunction
but erases itsIOException
for the compiler, while still throwing the exception at runtime.(package private) static <T> int
compare(IOComparator<? super T> comparator, T t, T u)
Delegates to the givenIOComparator
but erases itsIOException
for the compiler, while still throwing the exception at runtime.(package private) static <T> T
get(IOSupplier<T> supplier)
Delegates to the givenIOSupplier
but erases itsIOException
for the compiler, while still throwing the exception at runtime.(package private) static <T extends java.lang.Throwable>
java.lang.RuntimeExceptionrethrow(java.lang.Throwable throwable)
Throws the given throwable.(package private) static void
run(IORunnable runnable)
Delegates to the givenIORunnable
but erases itsIOException
for the compiler, while still throwing the exception at runtime.(package private) static <T> boolean
test(IOPredicate<? super T> predicate, T t)
Delegates to the givenIOPredicate
but erases itsIOException
for the compiler, while still throwing the exception at runtime.
-
-
-
Method Detail
-
accept
static <T,U> void accept(IOBiConsumer<T,U> consumer, T t, U u)
Delegates to the givenIOBiConsumer
but erases itsIOException
for the compiler, while still throwing the exception at runtime.- Type Parameters:
T
- See delegate.U
- See delegate.- Parameters:
consumer
- See delegate.t
- See delegate.u
- See delegate.- See Also:
IOBiConsumer
-
accept
static <T> void accept(IOConsumer<T> consumer, T t)
Delegates to the givenIOConsumer
but erases itsIOException
for the compiler, while still throwing the exception at runtime.- Type Parameters:
T
- See delegate.- Parameters:
consumer
- See delegate.t
- See delegate.- See Also:
IOConsumer
-
apply
static <T,U,R> R apply(IOBiFunction<? super T,? super U,? extends R> mapper, T t, U u)
Delegates to the givenIOBiFunction
but erases itsIOException
for the compiler, while still throwing the exception at runtime.- Type Parameters:
T
- See delegate.U
- See delegate.R
- See delegate.- Parameters:
mapper
- See delegate.t
- See delegate.u
- See delegate.- Returns:
- See delegate.
- See Also:
IOBiFunction
-
apply
static <T,R> R apply(IOFunction<? super T,? extends R> mapper, T t)
Delegates to the givenIOFunction
but erases itsIOException
for the compiler, while still throwing the exception at runtime.- Type Parameters:
T
- See delegate.R
- See delegate.- Parameters:
mapper
- See delegate.t
- See delegate.- Returns:
- See delegate.
- See Also:
IOFunction
-
compare
static <T> int compare(IOComparator<? super T> comparator, T t, T u)
Delegates to the givenIOComparator
but erases itsIOException
for the compiler, while still throwing the exception at runtime.- Type Parameters:
T
- See delegate.- Parameters:
comparator
- See delegate.t
- See delegate.u
- See delegate.- Returns:
- See delegate.
- See Also:
IOComparator
-
get
static <T> T get(IOSupplier<T> supplier)
Delegates to the givenIOSupplier
but erases itsIOException
for the compiler, while still throwing the exception at runtime.- Type Parameters:
T
- See delegate.- Parameters:
supplier
- See delegate.- Returns:
- See delegate.
- See Also:
IOSupplier
-
rethrow
static <T extends java.lang.Throwable> java.lang.RuntimeException rethrow(java.lang.Throwable throwable) throws T extends java.lang.Throwable
Throws the given throwable.- Type Parameters:
T
- The throwable cast type.- Parameters:
throwable
- The throwable to rethrow.- Returns:
- nothing because we throw.
- Throws:
T
- Always thrown.T extends java.lang.Throwable
-
run
static void run(IORunnable runnable)
Delegates to the givenIORunnable
but erases itsIOException
for the compiler, while still throwing the exception at runtime.- Parameters:
runnable
- See delegate.- See Also:
IORunnable
-
test
static <T> boolean test(IOPredicate<? super T> predicate, T t)
Delegates to the givenIOPredicate
but erases itsIOException
for the compiler, while still throwing the exception at runtime.- Type Parameters:
T
- See delegate.- Parameters:
predicate
- See delegate.t
- See delegate.- Returns:
- See delegate.
- See Also:
IOPredicate
-
-