Package ca.team3161.lib.utils
Class Assert
- java.lang.Object
-
- ca.team3161.lib.utils.Assert
-
public final class Assert extends java.lang.Object
Assertions. Contains static methods which take a boolean condition and throw an exception if these conditions do not hold. Useful for debugging and during development.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Assert.AssertionException
Indicates that an Assert statement has failed.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
assertFalse(boolean condition)
Assert that a condition is false.static void
assertFalse(java.lang.String reason, boolean condition)
Assert rhat a condition is false.static void
assertTrue(boolean condition)
Assert that a condition is true.static void
assertTrue(java.lang.String reason, boolean condition)
Assert that a condition is true.
-
-
-
Method Detail
-
assertTrue
public static void assertTrue(boolean condition)
Assert that a condition is true.- Parameters:
condition
- throw an exception if the given condition does not hold
-
assertTrue
public static void assertTrue(java.lang.String reason, boolean condition)
Assert that a condition is true.- Parameters:
reason
- why the condition should holdcondition
- throw an exception if the given condition does not hold
-
assertFalse
public static void assertFalse(boolean condition)
Assert that a condition is false.- Parameters:
condition
- throw an exception if the given condition holds
-
assertFalse
public static void assertFalse(java.lang.String reason, boolean condition)
Assert rhat a condition is false.- Parameters:
reason
- why the condition should not holdcondition
- throw an exception if the given condition holds
-
-