パッケージ org.nkjmlab.sorm4j.util
クラス Try
- java.lang.Object
-
- org.nkjmlab.sorm4j.util.Try
-
public final class Try extends Object
-
-
ネストされたクラスの概要
ネストされたクラス 修飾子とタイプ クラス 説明 static interfaceTry.ThrowableConsumer<T>static interfaceTry.ThrowableFunction<T,R>static interfaceTry.ThrowableRunnablestatic interfaceTry.ThrowableSupplier<T>
-
コンストラクタの概要
コンストラクタ コンストラクタ 説明 Try()
-
メソッドの概要
-
-
-
メソッドの詳細
-
createRunnable
public static Runnable createRunnable(Try.ThrowableRunnable onTry, Consumer<Throwable> onCatch)
-
createSupplier
public static <T> Supplier<T> createSupplier(Try.ThrowableSupplier<T> onTry, Function<Throwable,T> onCatch)
-
createSupplierWithThrow
public static <T,X extends RuntimeException> Supplier<T> createSupplierWithThrow(Try.ThrowableSupplier<T> onTry, Function<Throwable,? extends X> ex) throws X extends RuntimeException
- 例外:
X extends RuntimeException
-
createConsumer
public static <T,R> Consumer<T> createConsumer(Try.ThrowableConsumer<T> onTry, BiConsumer<Throwable,T> onCatch)
-
createConsumerWithThrow
public static <T,X extends RuntimeException> Consumer<T> createConsumerWithThrow(Try.ThrowableConsumer<T> onTry, Function<Throwable,? extends X> ex) throws X extends RuntimeException
- 例外:
X extends RuntimeException
-
createFunction
public static <T,R> Function<T,R> createFunction(Try.ThrowableFunction<T,R> onTry, BiFunction<Throwable,T,R> onCatch)
-
createFunctionWithThrow
public static <T,R,X extends RuntimeException> Function<T,R> createFunctionWithThrow(Try.ThrowableFunction<T,R> onTry, Function<Throwable,? extends X> ex) throws X extends RuntimeException
- 例外:
X extends RuntimeException
-
getOrNull
public static <T> T getOrNull(Try.ThrowableSupplier<T> onTry)
-
getOrThrow
public static <T,X extends RuntimeException> T getOrThrow(Try.ThrowableSupplier<T> onTry, Function<Throwable,? extends X> ex) throws X extends RuntimeException
- 例外:
X extends RuntimeException
-
runOrThrow
public static <T,X extends RuntimeException> void runOrThrow(Try.ThrowableRunnable onTry, Function<Throwable,? extends X> ex) throws X extends RuntimeException
- 例外:
X extends RuntimeException
-
-