-
@RestrictTo(value = RestrictTo.Scope.LIBRARY) public class DebugBuild
Debug utility definitions.
-
-
Method Summary
Modifier and Type Method Description static voidlog(String tag, String msg)Log message if debug build. static voidlog(String tag, String msg, Throwable err)Log message, with error cause, if debug build. static voidlog(String tag, String fmt, Array<Object> args)Log formatted message if debug build. static voidcheckState(boolean ok, String msg)Ensure state is valid if debug build, failing with messageotherwise. static voidcheckState(boolean ok)Ensure state is valid if debug build. static voidcheckArgument(boolean ok)Ensure argument is valid if debug build. static <T> TcheckNotNull(@Nullable() T obj)Ensure value is non- {@code null}if debug build.-
-
Method Detail
-
log
static void log(String tag, String msg)
Log message if debug build.
- Parameters:
tag- message tagmsg- message text
-
log
static void log(String tag, String msg, Throwable err)
Log message, with error cause, if debug build.
- Parameters:
tag- message tagmsg- message texterr- error cause
-
log
static void log(String tag, String fmt, Array<Object> args)
Log formatted message if debug build.
If
{@code args}is not empty, and its last element is a throwable,then the last argument is not used for formatting, and is used as an error cause.- Parameters:
tag- message tagfmt- message text formatargs- message arguments
-
checkState
static void checkState(boolean ok, String msg)
Ensure state is valid if debug build, failing with messageotherwise.
- Parameters:
ok-{@code true}if, and only if, state is validmsg- failure message
-
checkState
static void checkState(boolean ok)
Ensure state is valid if debug build.
- Parameters:
ok-{@code true}if, and only if, state is valid
-
checkArgument
static void checkArgument(boolean ok)
Ensure argument is valid if debug build.
- Parameters:
ok-{@code true}if, and only if, argument is valid
-
checkNotNull
static <T> T checkNotNull(@Nullable() T obj)
Ensure value is non-
{@code null}if debug build.- Parameters:
obj- value to test
-
-
-
-