Created
November 18, 2020 18:12
-
-
Save keeferrourke/5b7c9b0946cd418b90de09b0a1842b8d to your computer and use it in GitHub Desktop.
Revisions
-
keeferrourke created this gist
Nov 18, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ class JavaUtil { /** * Runtime checks, similar to the Kotlin standard library check method. */ public static void check(boolean condition, String message) { if (!condition) { throw new IllegalStateException(message); } } public static void check(boolean condition) { check(condition, "check failed"); } /** * Silence annoying IDE errors when drafting methods, similar to the Kotlin * standard library method. * For method stubs, simply `return TODO("Not implemented");`. */ @SuppressWarnings("UnusedReturnValue") public static <T> T TODO(String message) { throw new IllegalStateException(message); } public static <T> T TODO() { throw new IllegalStateException("TODO"); } }