public final class Misc extends Object
| Modifier and Type | Method and Description |
|---|---|
static <A,B> Function<A,B> |
cast()
Cast from A to B.
|
static <A,B> B |
cast(A v,
Class<B> to)
Cast from A to B with special treatment of the Number classes.
|
static <A extends Throwable,B> |
chuck()
chuck(Throwable) as a function. |
static <A> A |
chuck(Throwable t)
Throw a checked exception like a RuntimeException removing any needs to declare a throws clause.
|
static <A extends Exception> |
error(Class<A> cls,
String msg) |
static <A extends Exception> |
error(Class<A> cls,
String msg,
Throwable cause) |
static <A> Function<A,A> |
ifThen(A predicate,
A b) |
static <A> List<A> |
widen(Class<A> type,
List<? extends A> xs)
Widening cast.
|
static <A> Option<A> |
widen(Class<A> type,
Option<? extends A> xs)
Widening cast.
|
static <A> List<A> |
widen(List<? extends A> xs)
Widening cast.
|
static <A> Option<A> |
widen(Option<? extends A> xs)
Widening cast.
|
public static <A> A chuck(Throwable t)
public static <A extends Throwable,B> Function<A,B> chuck()
chuck(Throwable) as a function.public static <A,B> B cast(A v,
Class<B> to)
public static <A,B> Function<A,B> cast()
public static <A extends Exception> Function0<A> error(Class<A> cls, String msg, Throwable cause)
public static <A> Function<A,A> ifThen(A predicate, A b)
Copyright © 2009–2021 Opencast Project. All rights reserved.