mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 06:35:42 +00:00
41 lines
810 B
Java
41 lines
810 B
Java
package org.mozilla.gecko;
|
|
|
|
public class Assert
|
|
{
|
|
private Assert() {}
|
|
|
|
public static void equals(Object a, Object b)
|
|
{
|
|
equals(a, b, null);
|
|
}
|
|
|
|
public static void equals(Object a, Object b, String message)
|
|
{
|
|
Assert.isTrue(a.equals(b), message);
|
|
}
|
|
|
|
public static void isTrue(boolean a)
|
|
{
|
|
isTrue(a, null);
|
|
}
|
|
|
|
public static void isTrue(boolean a, String message)
|
|
{
|
|
if (!AppConstants.DEBUG_BUILD) {
|
|
return;
|
|
}
|
|
|
|
if (!a) {
|
|
throw new AssertException(message);
|
|
}
|
|
}
|
|
|
|
public static class AssertException extends RuntimeException
|
|
{
|
|
private static final long serialVersionUID = 0L;
|
|
|
|
public AssertException(String message) {
|
|
super(message);
|
|
}
|
|
}
|
|
} |