Added a static method for concise condition requirey in invocation services.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6583 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2011-04-02 00:48:01 +00:00
parent 248795ba57
commit 1203c59588
@@ -54,6 +54,18 @@ public class InvocationException extends Exception
requireAccess(clobj, perm, null);
}
/**
* Requires that the supplied condition be true, otherwise an invocation exception with the
* supplied error message is thrown.
*/
public static void require (boolean condition, String errmsg)
throws InvocationException
{
if (!condition) {
throw new InvocationException(errmsg);
}
}
/**
* Constructs an invocation exception with the supplied cause code string.
*/