Package org.robolectric.util
Class Util
java.lang.Object
org.robolectric.util.Util
Generic collection of utility methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Pathstatic <T extends Throwable>
RuntimeExceptionRe-throwt(even if it's a checked exception) without requiring athrowsdeclaration.
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
pathFrom
-
sneakyThrow
Re-throwt(even if it's a checked exception) without requiring athrowsdeclaration.This function declares a return type of
RuntimeExceptionbut will never actually return a value. This allows you to use it with athrowstatement to convince the compiler that the current branch will not complete.throw Util.sneakyThrow(new IOException());Adapted from https://www.mail-archive.com/javaposse@googlegroups.com/msg05984.html
- Throws:
T
-