クラス Try
java.lang.Object
org.nkjmlab.util.java.function.Try
-
ネストされたクラスの概要
ネストされたクラス修飾子とタイプクラス説明static interface
static interface
static interface
static interface
static interface
-
メソッドの概要
修飾子とタイプメソッド説明static <T,
S> BiConsumer<T, S> createBiConsumer
(Try.ThrowableBiConsumer<T, S> onTry, Consumer<Exception> onCatch) static <T,
S, X extends RuntimeException>
BiConsumer<T,S> createBiConsumerWithThrow
(Try.ThrowableBiConsumer<T, S> onTry, Function<Exception, ? extends X> ex) static <T,
R> Consumer<T> createConsumer
(Try.ThrowableConsumer<T> onTry, Consumer<Exception> onCatch) static <T,
X extends RuntimeException>
Consumer<T>createConsumerWithThrow
(Try.ThrowableConsumer<T> onTry, Function<Exception, ? extends X> ex) static <T,
R> Function<T, R> createFunction
(Try.ThrowableFunction<T, R> onTry, Function<Exception, R> onCatch) static <T,
R, X extends RuntimeException>
Function<T,R> createFunctionWithThrow
(Try.ThrowableFunction<T, R> onTry, Function<Exception, ? extends X> ex) static Runnable
createRunnable
(Try.ThrowableRunnable onTry, Consumer<Exception> onCatch) static <X extends RuntimeException>
RunnablecreateRunnableWithThrow
(Try.ThrowableRunnable onTry, Function<Exception, ? extends X> ex) static <T> Supplier<T>
createSupplier
(Try.ThrowableSupplier<T> onTry, Function<Exception, T> onCatch) static <T,
X extends RuntimeException>
Supplier<T>createSupplierWithThrow
(Try.ThrowableSupplier<T> onTry, Function<Exception, ? extends X> ex) static <T> T
getOrDefault
(Try.ThrowableSupplier<T> onTry, T defaultValue) static <T> T
getOrNull
(Try.ThrowableSupplier<T> onTry) static <T,
X extends RuntimeException>
TgetOrThrow
(Try.ThrowableSupplier<T> onTry, Function<Exception, ? extends X> ex) static <T,
X extends RuntimeException>
TgetWithCatch
(Try.ThrowableSupplier<T> onTry, Function<Exception, T> onCatch) static <T extends Throwable>
RuntimeExceptionstatic void
runOrElse
(Try.ThrowableRunnable onTry, Consumer<Exception> onCatch) static <T,
X extends RuntimeException>
voidrunOrThrow
(Try.ThrowableRunnable onTry, Function<Exception, ? extends X> ex)
-
メソッドの詳細
-
createBiConsumer
public static <T,S> BiConsumer<T,S> createBiConsumer(Try.ThrowableBiConsumer<T, S> onTry, Consumer<Exception> onCatch) -
createBiConsumerWithThrow
public static <T,S, BiConsumer<T,X extends RuntimeException> S> createBiConsumerWithThrow(Try.ThrowableBiConsumer<T, S> onTry, Function<Exception, throws X? extends X> ex) - 例外:
X extends RuntimeException
-
createConsumer
public static <T,R> Consumer<T> createConsumer(Try.ThrowableConsumer<T> onTry, Consumer<Exception> onCatch) -
createConsumerWithThrow
public static <T,X extends RuntimeException> Consumer<T> createConsumerWithThrow(Try.ThrowableConsumer<T> onTry, Function<Exception, ? extends X> ex) throws X- 例外:
X extends RuntimeException
-
createFunction
public static <T,R> Function<T,R> createFunction(Try.ThrowableFunction<T, R> onTry, Function<Exception, R> onCatch) -
createFunctionWithThrow
public static <T,R, Function<T,X extends RuntimeException> R> createFunctionWithThrow(Try.ThrowableFunction<T, R> onTry, Function<Exception, throws X? extends X> ex) - 例外:
X extends RuntimeException
-
createRunnable
-
createRunnableWithThrow
public static <X extends RuntimeException> Runnable createRunnableWithThrow(Try.ThrowableRunnable onTry, Function<Exception, ? extends X> ex) throws X- 例外:
X extends RuntimeException
-
createSupplier
public static <T> Supplier<T> createSupplier(Try.ThrowableSupplier<T> onTry, Function<Exception, T> onCatch) -
createSupplierWithThrow
public static <T,X extends RuntimeException> Supplier<T> createSupplierWithThrow(Try.ThrowableSupplier<T> onTry, Function<Exception, ? extends X> ex) throws X- 例外:
X extends RuntimeException
-
getOrDefault
-
getOrNull
-
getOrThrow
public static <T,X extends RuntimeException> T getOrThrow(Try.ThrowableSupplier<T> onTry, Function<Exception, ? extends X> ex) throws X- 例外:
X extends RuntimeException
-
rethrow
- 例外:
T extends Throwable
-
runOrThrow
public static <T,X extends RuntimeException> void runOrThrow(Try.ThrowableRunnable onTry, Function<Exception, ? extends X> ex) throws X- 例外:
X extends RuntimeException
-
runOrElse
-
getWithCatch
public static <T,X extends RuntimeException> T getWithCatch(Try.ThrowableSupplier<T> onTry, Function<Exception, T> onCatch)
-