parent
e7dd1a131e
commit
9f94469ff1
@ -1,20 +0,0 @@ |
|||||||
package me.bearns.fias.helpers; |
|
||||||
|
|
||||||
import me.bearns.fias.exceptions.UnmarshallingException; |
|
||||||
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; |
|
||||||
|
|
||||||
import java.util.function.BiConsumer; |
|
||||||
|
|
||||||
public interface ThrowingBiConsumer<K extends UnmarshallerParameters, V extends ZipArchiveEntry, E extends Throwable> { |
|
||||||
void accept(K k, V v) throws E; |
|
||||||
|
|
||||||
static <K extends UnmarshallerParameters, V extends ZipArchiveEntry, E extends Throwable> BiConsumer<K,V> unchecked(ThrowingBiConsumer<K, V, E> f) { |
|
||||||
return (k,v) -> { |
|
||||||
try { |
|
||||||
f.accept(k,v); |
|
||||||
} catch (Throwable e) { |
|
||||||
throw new RuntimeException(e); |
|
||||||
}; |
|
||||||
}; |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue