|
|
|
|
|
by lmm
2378 days ago
|
|
You can actually use a generic parameter in a throws clause, so you can write something like: interface FunctionThrows1<S, T, E1 extends Throwable> {
T apply(S in) throws E1
}
interface FunctionThrows2<S, T, E1 extends Throwable, E2 extends Throwable> {
T apply(S in) throws E1, E2
}
...
But you still have to write one version of your method for each arity of throwing that you want to be able to wrap. |
|